xHarbour Reference Documentation > Function Reference xHarbour Developers Network  

PosDel()

Deletes character(s) at a specified position in a string.

Syntax

PosDel( <cString>, [<nPos>], [<nCount>] ) --> cResult

Arguments

<cString>
This is the character string to delete one or more characters from.
<nPos>
This is the numeric ordinal position of the first character in <cString> to start deleting from. It defaults to the last character (Len(<cString>)).
<nCount>
A numeric value specifies the number of characters to delete. The default value is 1 character.

Return

The function removes the requested numnber of characters and returns the modified string.

Info

See also:AtRepl(), PosIns(), PosRange(), Stuff()
Category: CT:String manipulation , Character functions
Source:ct\pos2.c
LIB:xhb.lib
DLL:xhbdll.dll

Example

// The example displays results of PosDel()

   PROCEDURE Main
      LOCAL cString := "xHarbour"

      ? PosDel( cString )         // result: xHarbou

      ? PosDel( cString, 3, 2 )   // result: xHbour

      ? PosDel( cString,  , 3 )   // result: xHarb
   RETURN

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