xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

ReplRight()

Replaces a specified character on the right side of a string.

Syntax

ReplRight( <cString> , ;
          <xReplace>, ;
         [<xSearch>]  ) --> cResult

Arguments

<cString>
This is the character string to replace characters on the right side.
<xReplace>
This is a single character or its numeric ASCII code that replaces <xSearch> on the right side of <cString>.
<xSearch>
A single character or its numeric ASCII code can be passed. This character is replaced by <xReplace>. The default value is a space character (Chr(32)).

Return

The function replaces characters specified with <xSearch> at the end of <cString> with <xReplace> and returns the modified string.

Info

See also:ReplAll(), ReplRight(), StrTran()
Category: CT:String manipulation , Character functions
Source:ct\replace.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of ReplRight()

   PROCEDURE Main
      LOCAL cStr1 := "  xHarbour  "
      LOCAL cStr2 := "00012345,000"

      ? ">"+ReplRight( cStr1, "_" )+"<"        // result: >  xHarbour__<

      ? ">"+ReplRight( cStr2, "x", "0" )+"<"   // result: >00012345,xxx<
   RETURN

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