String returning always true

Hi UiPath,

Let say I have the string variable strTxt=“HPE 5Y TC BAS SE1660 1860WSIOT2019STGSVC”

and when I use the strTxt.contains(“SVC”) it is always returning true.

I want it to return false because the 1860WSIOT2019STGSVC is part of 1 word.

I only want it to return True if the “SVC” is 1 word only.

hope this make sense.

thanks in advance.

Hi @alvin.c.apostol26

System.Text.RegularExpressions.Regex.IsMatch(strTxt, "\bSVC\b")

Use this regex in if condition

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