StrTran Function

Action

Searches for and replaces characters in a string.

Syntax

sChanged = StrTran (sOrig, sSearch, sReplace)
Variable Description
sChanged The returned string. STRING.
sOrig The string to search. STRING.
sSearch The string to search for in sOrig. STRING.
sReplace The string to substitute for sSearch. STRING.

Notes

StrTran searches sOrig for the string sSearch. When it finds a match, it replaces sSearch with sReplace. All instances of sSubstr in sOrig are replaced.

Example

STRING s = "one and two and three"
Print (StrTran (s, "and", "&" ))
// prints: one & two & three