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