xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

WordToChar()

Replaces words (2 byte sequence) with characters (1 byte)

Syntax

WordToChar( <cWordList>, ;
            <cString>  , ;
            <cCharList>  ) --> cResult

Arguments

<cWordList>
This is a character string holding 2-byte sequences (words) to search for in <cString>.
<cString>
This is the character string to process.
<cCharList>
This is a character string holding the characters (1-byte) which replace the corresponding words of <cWordList> in <cString>.

Return

The function scans <cString> for all words (2-byte sequence) contained in <cWordList> and replaces them with the corresponding character specified with <cCharList>. The modified character string is returned.

Info

See also:CSetAtMuPa(), CharRepl(), WordRepl()
Category: CT:String manipulation , Character functions
Source:ct\wordtoch.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of WordToChar()

   PROCEDURE Main
      LOCAL cString := "abab12cd1212cdefef"

      ? WordToChar( "12", cString, "_" )        // result: abab_cd__cdefef

      ? WordToChar( "abcdef", cString, "XYZ" )  // result: XX12Y1212YZZ

   RETURN

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