To check entire string is in uppercase in Uipath

to check entire string is in uppercase
my string is APPLE here i want to check the string is in uppercase

1 Like

Hi @brindhaS

if (StrVar.ToString.ToUpper.Contains(“APPLE”)

Thanks
Ashwin S

You can use an equals operator ‘=’ or use String.Equals method to check. I’ll assume your APPLE is saved to a variable called str1.

str1 = str1.ToUpper

String.Equals(str1,str1.ToUpper)

Both of these options work. When you put it in an if statement, true = str1 is uppercase, false = str1 has at least 1 letter that is not uppercase

1 Like

my entire string is in uppercase sometimes i just wanna check whether is in upper case or not

Hello,

In the attachment you can find the solution implemented.

Have a nice day,
Bianca
CheckUpper.xaml (13.2 KB)

Thanks,check any of the string is in Uppercase not by using .Toupper()

@brindhaS

I hope I understood your requirement

use below code in Assign activity or message box

system.Text.RegularExpressions.Regex.IsMatch(YourInput stringvariable,"^[^a-z]+$").ToString

or

system.Text.RegularExpressions.Regex.IsMatch(“APPLE REDMI REALME”,"^[^a-z]+$").ToString

It returns true When all Character as Uppercase otherwise returns false

2 Likes

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