xHarbour Reference Documentation > Function Reference |
Replaces a specified character on both sides of a string.
ReplAll( <cString> , ; <xReplace>, ; [<xSearch>] ) --> cResult
The function replaces characters specified with <xSearch> at the beginning and end of <cString> with <xReplace> and returns the modified string.
See also: | ReplLeft(), ReplRight(), StrTran() |
Category: | CT:String manipulation , Character functions |
Source: | ct\replace.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example displays results of ReplAll() PROCEDURE Main LOCAL cStr1 := " xHarbour " LOCAL cStr2 := "00012345,000" ? ">"+ReplAll( cStr1, "_" )+"<" // result: >__xHarbour__< ? ">"+ReplAll( cStr2, "x", "0" )+"<" // result: >xxx12345,xxx< RETURN
http://www.xHarbour.com