str = StrDelete(sString,nStart,nLength)
This macro function deletes characters from sString, starting at the position nStart for nLength characters.
The first character is at position 1. A starting position or requested length beyond the end of the string is handled as follows:
•If nStart is larger than the length of sString, then the result will be the unmodified string sString.
•If nStart+nLength-1 is larger than the length of sString, deletion continues to the end of the string, leaving only the characters before nStart.
StrDelete('Hello',2,1) = 'Hllo'
StrDelete('Hello',2,3) = 'Ho'
StrDelete('Hello',2,4) = 'H'
StrDelete('Hello',2,1000) = 'H'
StrDelete('Hello',1000,3) = 'Hello' // no deletion
The functions StrDelete and StrCopy are complementary. What is deleted from a string using StrDelete, is what would have been copied with StrCopy, assuming the same parameters.
See also: StrCopy.
Topic 108276, last updated on 18-Apr-2020