Christine_Chavez_6412

Getting around STR_SUB case sensitivity

Discussion created by Christine_Chavez_6412 on Feb 20, 2017
STR_SUB (among other AE function) is case sensitive by design.

If you have string "Abcdefg", and you're looking for pattern "ABC", it will not be able to find it because it is case sensitive. 

Example:
:SET &str# = "Abcdefg"
:SET &pattern# =  "ABC"
:SET &new# = STR_SUB(&str#,&pattern#,"") 
:PRINT new = &new#

Result:
new=Abcdefg

To get around this, you can convert the string and pattern to either all upper case or lower case.

See: https://docs.automic.com/documentation/webhelp/english/ALL/components/AE/11.2/All%20Guides/help.htm#ucaagy.htm%3FTocPath%3DAutomation%2520Engine%2520Script%2520Guide%7COrdered%2520by%2520Function%7CStrings%7C_____27

Example:
:SET &str# = CONV_UC("Abcdefg") 
:SET &pattern# = CONV_UC("ABC") 
:SET &new# = STR_SUB(&str#,&pattern#,"") 
:PRINT new = &new#

Result:
new=DEFG


Outcomes