Find word in string

i have a string like: “Mark Jones Mr”
and i need to create if statement and find “Mr” in string.
If “Mr” exists, then log message … “my text here”
i know how do if statement, but i dont know how to make a check “Mr”.

hi @Arettu63,

welcome to the Uipath Community !

  1. Assuming you have the text in String Variable : StringMain : “Mark Jones Mr”

  2. In If we Write : StringMain.Contains(“Mr”)

This Will Return True/ False … Here “Mr” can be also stored in a string variable say strTexttoSearch to make it more dynamic.

Then we Write StringMain.Contains(“strTexttoSearch”)


Mukesh

2 Likes

Hi @Arettu63

Please find below screenshot I hope you will get solution

Regards,
Kommi Jeevan.

2 Likes

Cheers @Arettu63 if you find it useful mark it as solution and close the thread.

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