strReplace(str,old,new)

Replaces occurrences of a target string within the input string.


Syntax

strreplace(str,old,new)
str: scalar Text - input string
old: scalar Text - target string
new: scalar Text - replacement string
return: Text with substituted string

Usage

The input string is searched for the target string. When found the replacement string is inserted in place of the target string. The resulting string is then processed in the same way until target string is no longer found.

Location

menu: veeos ==> math ==> strReplace

library: mathLib

Example

strReplace("I thunk this is an unterestung strung","un","in")

returns "I think this is an interesting string"

Notes

This objects recursively looks through the string to find and replace strings. Hence it may be possible to have unintended results if one replacement triggers another. In the future may want to rewrite to take this into account.

Reference

Supported On

VEE 7.0+. All platforms.

See Also


© 2015. All Rights Reserved.  Stan Bischof (stan@worldbadminton.com). Last updated 20 October 2015 20:38.