4D v13.4

Delete string

Home

 
4D v13.4
Delete string

Delete string 


 

Delete string ( source ; where ; numChars ) -> Function result 
Parameter Type   Description
source  String in String from which to delete characters
where  Longint in First character to delete
numChars  Longint in Number of characters to delete
Function result  String in Resulting string

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

Delete string returns the same string as source when:

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

 
PROPERTIES 

Product: 4D
Theme: String
Number: 232

 
INDEX

Alphabetical list of commands

 
HISTORY 

Created: < 4D v6

 
SEE ALSO 

Change string
Insert string
Replace string