␡
- Reverse()
- Find()
- Quick Rules for Using CFScript
- FindNoCase()
- REReplace
- ReplaceList()
Like this article? We recommend
FindNoCase()
We must also update the expression inside the if block. In order to make sure that "Anna" and "anna" are both recognized as equivalent, we must use the FindNoCase() function. The Find() function is case-sensitive and will therefore reject "Anna" as a palindrome. Using the FindNoCase() function in just the same way as its case-sensitive counterpart gives us the result we want.
Next, let's strip out any spaces that might be present in the string. To do this, we need to use the ColdFusion regular expression function REReplace.