xHarbour Reference Documentation > Function Reference |
Removes duplicate adjacent characters from a string.
CharOne( [<cDelete>], <cString> ) --> cResult
The function searches for duplicate adjacent characters in <cString> and removes them in the result string.
Note: the function differs from CharList() which removes all duplicates. CharOne() removes only adjacent duplicates.
See also: | CharList(), CharOnly(), CharRem(), WordOne() |
Category: | CT:String manipulation , Character functions |
Source: | ct\charone.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example outlines the difference between CharOne() // and CharList() PROCEDURE Main LOCAL cString := "11ab12bb33cc" ? CharOne( "abc123", cString ) // result: 1ab12b3c ? CharList( cString ) // result: 1ab23c RETURN
http://www.xHarbour.com