mesalcan
(Marco Salazar)
1
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!
TimK
(Tim Kok)
2
replace all before splitting the string then you only need to do it once.
So VendorInformation .replace(“\n”,“”).replace(“\r”,“”)
Then VendorInformation.Split…
mesalcan
(Marco Salazar)
3
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
ppr
(Peter Preuss)
5
Give a try to StringVariable.Replace(Environment.NewLine, “|”) and replace linebreaks with |
2 Likes
mesalcan
(Marco Salazar)
6
Thanks! this did the magic!
system
(system)
Closed
7
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.