Manipulate string

Hello friends,

@Rammohan91, @balupad14, @Gouda_6, @Florent_Salendres, @ClaytonM, @vvaidya, @Palaniyappan

I have this string:
“AUD
NOK”

How to remove the new line from this dtring?
Thank you,
Cami :slight_smile:

Hi @CamiCat

Buddy
Assign this string to a string variable and use split method like
firstword = Split(enviroment.newline.toarray(),stringsplitoptions.Removeemptyentries)(0).Tostring

Secondword = Split(enviroment.newline.toarray(),stringsplitoptions.Removeemptyentries)(1).Tostring

Or even you can get this as array or list and get the value one by one by mentioning the index of the value

Hope this would help you

Cheers…

2 Likes

Thank you so much @Palaniyappan.
How to concatenate the words so that is becomes USDNOK?
Thank you,
Cami :=)

1 Like

Once you get them as separate string values
assign activity with
combined_value = firstword +secondword

or even better from that split itself

Combined_value = Split(enviroment.newline.toarray(),stringsplitoptions.Removeemptyentries)(0).Tostring
+
Split(enviroment.newline.toarray(),stringsplitoptions.Removeemptyentries)(1).Tostring

Hope this would help you buddy

Cheers

1 Like

Hello,

Personnaly I would do an assign with this statement :
YourStringWithoutNewLine = YourString.Replace(vbNewLine, string.Empty)

Regards

2 Likes

Hi @CamiCat

Please use Below code YourString.Replace(Chr(10),“”) . This will give you expected output.

Use Assign Activity like YourString = YourString.Replace(Chr(10),“”). This will replace those characters and save the value in same Variable.

Regards,
Vijay.

1 Like

@CamiCat,

Can you please use this logic for replace and concatenate the words in single line of string.

System.Text.RegularExpressions.Regex.Replace(myString,“[\n]”,“”)

Thanks,
Arunachalam.

1 Like