xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

RangeRepl()

Repleaces character(s) within a specified range of characters.

Syntax

RangeRepl( <cRangeStart>, ;
           <cRangeEnd>  , ;
           <cString>    , ;
           <cReplace>     ) --> cResult

Arguments

<cReplace>
This is a single character which replaces all characters within the specified range.

Return

The function replaces all characters with in the specified range with <cReplace> and returns the modified string.

Info

See also:CharRepl(), PosRepl(), PosRange(), RangeRem()
Category: CT:String manipulation , Character functions
Source:ct\range.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// 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

Copyright © 2006-2007 xHarbour.com Inc. All rights reserved.
http://www.xHarbour.com
Created by docmaker.exe