I’m using the GetFullText activity and I get a string back of this type
I then try to read if the string contains “Standard place1” but when I write it simply like this with a space in between the bot doesn’t enter that if statement.
how can I approach this issue?
inputString = "Standard\t\nplace1\t\nname surname\t\nplace2\t\nplace3"
searchString = "Standard place1"
// Trim whitespace and line breaks
inputString = inputString.Replace("\t\n", " ").Trim
searchString = searchString.Trim
// Perform a case-insensitive comparison
// Your code here if the condition is met
// Your code here if the condition is not met
Hope it helps!!
you can replace the string and then check with the if - activity with condition it will work sure
you can try like this…
str = “Standard\t\nplace1\t\nname surname\t\nplace2\t\nplace3”.Replace(“\t\n”," ")
you can give if condition like this
if = str.contains(“Standard place1”)
for the refernce you can see the screenshot
You can use Regex also
please try this
hope it helps
StrGetFullTextInput.ToString.Contains(“Standard”) and StrGetFullTextInput.ToString.Contains(“place1”)
the string contains a tab and a new line, it is not physically written when I display the string in a message box it looks like this
so using Replace(“\t\n”," ") is not helping
This will give you the string in a single line
You can try like this then, it will replace multiple lines to single line
str = Regex.Replace(str,“\r?\n”," ")
hope it may helpfull for you
when \t\n are copy pastes from e.g. debugging panels and representing a proper tab or line break we can use isMatch / Regex.Match for a defensive check:
strText = your Text
myCheck | Boolean = System.Text.RegularExpressions.Regex.IsMatch(strText, strPattern)
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum
thank you @ppr this solved my case
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.