M1288
(Meg1288)
1
Hi,
I recently encountered a problem while using Get text activity from website, the value will be assigned to string variable as below ( in 2 lines)
@“This is the sample
string text for testing”
I tried using replace, remove, trim methods but its not working
Can anyone please help on how can we remove @ in the beginning and also how can we bring it to in one line
Thanks in advance
Yoichi
(Yoichi)
2
Hi,
How did you check it? If in Locals panel, it’s C# syntax and we can ignore it because the @sign
is not content of the variable.
Regards,
rlgandu
(Rajyalakshmi Gandu)
3
@M1288
Remove the "@" symbol
textValue = textValue.TrimStart("@"c)
Bring the text to one line
textValue = textValue.Replace(vbCrLf, " ")
or
yourStringVariable = yourStringVariable.Replace("@", "").Replace(Environment.NewLine, " ").Trim()
or
yourStringVariable = System.Text.RegularExpressions.Regex.Replace(Input,"@","").Replace(Environment.NewLine, " ").Trim()
vrdabberu
(Varunraj Dabberu)
4
Hi @M1288
I think you are copying the text from the locals panel. In the locals panel you get the way as in below image
to get the whole string in one line you can use below syntax:
originalText= "This Is the sample
String text For testing"
cleanedText= originalText.ReplaceLineEndings(" ")
Regards
pikorpa
(Piotr Kołakowski)
5
hey @M1288
try this:
processedString = inputString.Trim().Replace("@", "").Replace(vbCrLf, " ").Replace(vbCr, " ").Replace(vbLf, " ")
vrdabberu
(Varunraj Dabberu)
6
Hi @M1288
Please check the below thread
Regards
vrdabberu
(Varunraj Dabberu)
7
Hi @M1288
Please check the below thread:
Regards
postwick
(Paul Ostwick)
8
That @ isn’t actually in the data, it’s just the way it displays during debugging.
system
(system)
Closed
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.