Searches for and replaces characters in a string.
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. |
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.
STRING s = "one and two and three" Print (StrTran (s, "and", "&" )) // prints: one & two & three