Delete string

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 3


Delete string (source; where; numChars) String

ParameterTypeDescription
sourceStringString from which to delete characters
whereNumberFirst character to delete
numCharsNumberNumber of characters to delete
Function resultStringResulting string

Description

Delete string deletes numChars from source, starting at where, and returns the resulting string.

Delete string returns the same string as source when:

source is an empty string

where is greater than the length of Source

numChars is zero (0)

If where is less than one, the characters are deleted from the beginning of the string.

If where plus numChars is equal to or greater than the length of source, the characters are deleted from where to the end of source.

Example

The following example illustrates the use of Delete string. The results are assigned to the variable vtResult.

   vtResult:=Delete string("Lamborghini"; 6; 6)  ` vtResult gets "Lambo" 
   vtResult:=Delete string("Indentation"; 6; 2)  ` vtResult gets "Indention" 
   vtResult:=Delete string(vtOtherVar;3;32000)  ` vtResult gets the first two characters of vtOtherVar

See Also

Change string, Insert string, Replace string.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next