How to check if the last line of text contains special characters?I always need to check the file’s last line if it contains lv.exe.I also refer to the topic:How to check if last line of text file contains one word?, but it returns to the error:
sample.txt (774 Bytes)
Here Datatest is Output Varible of Read Text File
welcome back to uipath community
Kindly try like this
bool_output = System.Text.RegularExpressions.Regex.IsMatch(strinput.tostring.Split(Environment.Newline.ToArray()).Last().ToString,“(.exe)”)
Can you please tell me where is the part which looks for special characters?
.exe is the one we want to search and to ensure whether its there or not right… buddy
for that we can directly mention that instead of mentioning the special characters \W
if we know the exact special character then we can include that in the ISMATCH argument, as if we mention \W it will even include Space as a special non word character
thats why mentioned .exe as a match to be found directly
This also works, thanks all the same.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.