changeString
changeString ( source : string , newChars : string , where : integer ) : string
| Parameter | Type | Description | |
|---|---|---|---|
| source | string | → | Original string |
| newChars | string | → | New characters |
| where | integer | → | Where to start the changes |
| Result | string | ← | 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"