Compare string values without considering the case of alphabets

1
Hello Team , I’m having a string input . I need to compare the input string with default value which I have . For ex . I have input “CAT” and it is stored in one attribute. Name of the attribute is NameAttr . I’m trying to compare the default value with string with contains function  . Like   Contains ( NameAttr , ‘cat’) . But It won’t return true . Because input is in capital letters and default value is lower case . Can anyone please suggest any functions or any other activity to check the string input value with default text . And it should not consider the input value is  upper case or lower case like that .  Thanks in Advance !
asked
4 answers
2

Hi Vinodhini,

 

Try using this 

 

contains(toLowerCase($Entity/NameAttr),'cat')


 

answered
1

Hi Vinodhini,

you can convert the string to uppercase and then compare it with the respective string

toUpperCase('Cat')='CAT'

or you can convert the string to lowercase and then compare it

toLowerCase('CAT')='cat'

 

answered
0

Try using isMatch with a regex:

isMatch($stringVariable, '(?i)cat')

Or compare using lowercase:

toLowerCase($stringVariable) = 'cat'

 

answered
0

If you want to use Contains, this should do the trick:

 

contains(toLowerCase($Entity/NameAttr), 'cat')

 

answered