Skip to main content

changeString

changeString ( source : string , newChars : string , where : integer ) : string

ParameterTypeDescription
sourcestring->Original string
newCharsstring->New characters
whereinteger->Where to start the changes
Resultstring<-Resulting string

Description

The changeString command changes a group of characters in source and returns the resulting string. The command overlays source, with the characters in newChars, at the character described by where.

If newChars is an empty string (""), changeString returns source unchanged. changeString always returns a string of the same length as source. If where is less than one or greater than the length of source, changeString returns source.

changeString is different from insertString in that it overwrites characters instead of inserting them.

Example

var vtResult : string
vtResult = changeString("Acme","CME",2) //vtResult gets "ACME"
vtResult = changeString("November","Dec",1) //vtResult gets "December"

See also

deleteString
insertString
replaceString