xHarbour Reference Documentation > Function Reference |
Repleaces character(s) within a specified range of characters.
RangeRepl( <cRangeStart>, ; <cRangeEnd> , ; <cString> , ; <cReplace> ) --> cResult
The function replaces all characters with in the specified range with <cReplace> and returns the modified string.
See also: | CharRepl(), PosRepl(), PosRange(), RangeRem() |
Category: | CT:String manipulation , Character functions |
Source: | ct\range.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
// The example demonstrates results of RangeRepl() PROCEDURE Main LOCAL cString := "The xHarbour Compiler" // replace lower case characters from "o" to "z" ? RangeRepl( "o", "z", cString, "_" ) // result: The _Ha_b___ C_m_ile_ // remove upper case characters from "A" to "Z" ? RangeRepl( "A", "Z", cString, "?" ) // result: ?he x?arbour ?ompiler RETURN
http://www.xHarbour.com