Replaces all occurrences of a substring in a string with a new substring. If any argument is NoValue , the function returns NoValue .
stringReplace ( str As Any, _
substr As Any, _
replstr As Any ) As Any
Argument | Type | Description |
---|---|---|
str | Any | a string to search in. |
substr | Any | a substring of characters to look for. |
replstr | Any | a substring of characters to replace with. |
Intent >stringReplace("Three big dogs are chasing", "dog", "pig")
--> "Three big pigs are chasing"
Intent >stringReplace("Two small cats", "dogs", "foxes")
--> "Two small cats"
The substring was not found, so no substitution occurred. Intent >stringReplace("Two small cats", NoValue, "foxes")
--> NoValue