Writing String

Hi all,
I have a sample text like
My name is xyz. I have GRANTEED you my card. You can GRTEE me my card.

From this text I want to check if GRANTEED or GRTEE is present or not.
If those words are there in the text then I need to print those words in log message or msg box.

Can anyone help me with this
Thanks in advance

Hi @honey.123.631

You can use a contains functions with or condition.

For eg: StrData=“My name is xyz. I have GRANTEED you my card. You can GRTEE me my card.”

you can use the expression in an if statement:

strData.contains(“GRANTEED”) or strData.contains(“GRTEE”)
in the then section use log message and simply print the words.

Thanks,

Happy Automation!

Hi,

Can you try the following sample?

keywords = {"GRANTEED","GRTEE"}
arrMatch = System.Text.RegularExpressions.Regex.Matches(yourString,"\b"+String.Join("\b|\b",keywords)+"\b").Cast(Of System.Text.RegularExpressions.Match).Select(Function(m) m.Value).Distinct().ToArray()

Sample

Sample20230522-4aLv2.zip (2.6 KB)

Regards,