xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

CharMirr()

Reverses the order of characters in a string.

Syntax

CharMirr( <cString>, [<lNoSpaces>] ) --> cResult

Arguments

<cString>
This is the character string to process.
<lNoSpaces>
This parameter defaults to .F. (false) so that trailing spaces of the input string are included at the beginning of the result string. Passing .T. (true) causes the function to ignore trailing spaces of <cString>, and leave them at the end of the result string.

Return

The function reverses the order of the characters in <cString> and returns the result.

Info

See also:CharList()
Category: CT:String manipulation , Character functions
Source:ct\charmirr.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of CharMirr()

   PROCEDURE Main
      LOCAL cString1 := "abcdef"
      LOCAL cString2 := "xHarbour  "

      ? ">"+CharMirr( cString1 )+"<"       // result: >fedcba<

      ? ">"+CharMirr( cString2 )+"<"       // result: >  ruobraHx<
      ? ">"+CharMirr( cString2, .T. )+"<"  // result: >ruobraHx  <
   RETURN

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe