Please enable JavaScript to view this site.

 

str = StrCopy(sString,nStart,nLength)

 

This macro function copies nLength characters from sString, starting at the position nStart.

 

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 a blank string.

•If nStart+nLength-1 is larger than the length of sString, then the result will only include characters until the end of sString.

StrCopy('Hello',2,1) = 'e'
StrCopy('Hello',2,3) = 'ell'
StrCopy('Hello',2,4) = 'ello'
StrCopy('Hello',2,1000) = 'ello'
StrCopy('Hello',1000,3) = '' // blank

See also: StrDelete.

 


Topic 108275, last updated on 18-Apr-2020