String manipulation issues

Hi,

I am having some trouble with string manipulation, as you can see, following is the assignment I am doing:

VendorInformation has the following value:

“TaxID: RO212121\r\nName: Green Restaurant\r\nAddress: Strada Verde 67\r\nCity: Iasi, Romania”

And this is what I am geeting:

I do not know why “\d\r” are still there. Any help would be highly appreciated.

Thanks!

replace all before splitting the string then you only need to do it once.

So VendorInformation .replace("\n","").replace("\r","")

Then VendorInformation.Split…

I have tried that also; but I got the same result. I have even tried to do twice the Replace("\n","").replace("\r","") with the same wrong results.

Thanks!

HI @mesalcan

Try replacing the \n \r stuff using the below code

StringVariable.Replace(Chr(10), "|").TrimStart.TrimEnd

Give a try to StringVariable.Replace(Environment.NewLine, “|”) and replace linebreaks with |

2 Likes

Thanks! this did the magic!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.