The Compare function compares two strings and returns 0 if they match. If the strings do not match the function returns the index of the characters which do not match. The shorter string is extended with a padding character so that the lengths match.
result = Compare( string1, string2 [, pad ] ] ) |
Examples:
say Compare( 'magic', 'magic' ) -- shows 0 say Compare( 'MAGIC', 'magic' ) -- shows 1 .. character case does not match say Compare( 'magic', 'magi' ) -- shows 5 say Compare( 'magic', 'magic ', '+' ) -- shows 6 .. the plus sign does not match the trailing space |