xHarbour Reference Documentation > Function Reference |
Replaces words (2 byte sequence) with characters (1 byte)
WordToChar( <cWordList>, ; <cString> , ; <cCharList> ) --> cResult
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.
See also: | CSetAtMuPa(), CharRepl(), WordRepl() |
Category: | CT:String manipulation , Character functions |
Source: | ct\wordtoch.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// 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
http://www.xHarbour.com