Mirror a string
CHARMIRR( <[@]cString>, [<lDontMirrorSpaces>] ) -> cMirroredString
<[@]cString> is the string that should be mirrored [<lDontMirrorSpaces>] if set to .T., spaces at the end of <cString> will not be mirrored but kept at the end Default: .F., mirror the whole string
<cMirroredString> the mirrored string
The CHARMIRR() function mirrors a string, i.e. the first character will be put at the end, the second at the last but one position etc.. One can use this function for index searches, but then, the spaces at the end of the string should not be mirrored. One can omit the return value of the function by setting the CSETREF() switch to .T., but <cString> must then be passed by reference to get a result.
? charmirr( "racecar" ) // "racecar" ? charmirr( "racecar ", .T. ) // "racecar " ? charmirr( "racecar ", .F. ) // " racecar"
charmirr( "racecar" ) == "racecar" charmirr( "racecar ", .T. ) == "racecar " charmirr( "racecar ", .F. ) == " racecar"
CHARMIRR() is compatible with CT3’s CHARMIRR().
Source is charmirr.c, library is ct3.