The StringBuffer class / base.StringBuffer methods |
Compare strings (case insensitive)
equalsIgnoreCase( reference STRING ) RETURNING result BOOLEAN
The equalsIgnoreCase() method compares the current string buffer with the passed string, ignoring the character case.
Since the parameter for the method must be a string, you can use the toString() method to convert a base.StringBuffer object in order to compare it.
The method returns TRUE if the strings are identical, otherwise it returns FALSE.
DEFINE buf3 base.StringBuffer LET buf3 = base.StringBuffer.create() CALL buf3.append("there") IF buf3.equalsIgnoreCase("There") THEN DISPLAY "buf matches There ignoring case" END IF
Output:
buf matches There ignoring case