basic.swap Function/BASIC Program

basic.swap

Command basic.swap Function/BASIC Program
Applicable release versions: AP 6.2, R91
Category BASIC Program (486)
Description searchs a "string.expression" for the "search.string" and then, if at the "start" occurrence, will replace "search.string" with "replacement.string" for "occurrences" occurrences. If "start" or "occurrences" are omitted, they will default to 1 and 0 respectively. An "occurrence" setting of 0 will replace all occurrences of "search.string" with "replacement.string".
Syntax swap(string.expression,search.string,replacement.string{,occurances{,start}})
Options
Example
nstring = swap("The new time","new","old")
The assigns the value "The old time" to nstring.

 print swap("---","-","+",2,1)
 This will output "-+-". The "swap" function will replace 
one occurrence of "-" starting at the second occurrence.
Purpose
Related basic.statements
basic.string.expression
basic.$options
basic.ereplace
basic.change