How to read a string and ignore the casing

Hi all,
I want to read a string that I extract, for example “Today”, regardless of the upper or lower casing in it. So the string could be “today” or “TODAY” and the bot will still read it. How do I do this?

@anonymous3 - One option would be using Regex and choose IgnoreCase if you are using ‘Matches’ activity …OR if you are using Assign activity you can use

system.text.RegularExpressions.Regex.match(YourString,"YourPattern", RegexOptions.IgnoreCase)

Hope this helps…

Hi @prasath17

What should I fill in for “Your Pattern”?

system.text.RegularExpressions.Regex.match("TODAY","today", RegexOptions.IgnoreCase)

This is just example to showcase the casing option.

Hi @anonymous3

Are you using get text to extract data, if yes then it will read as it is.

And if you want to compare this.string then do like this,

StrText - Today

strText.tolower = “today”

Thanks

Hi @prasath17,

This works fine. Thank you!

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