Water 5-Common Data Types-String, Bytes, and Char
method replace
Contract
Return typewob
Parameter keyDefault valueType
old_valuereq
new_valuereq
include"all"string
copyfalseboolean
Water Contract
<method replace
  old_value=req
  new_value=req
  include  ="all"
  copy     =false/>
_subject is a string, a vector or a record. Replaces all occurrences of old_elt at vector fields with new_elt. If _subject is a string, then old_elt and new_elt must either both be strings or both be chars. If the mutable argument is false then a new object is created and returned. If the mutable argument is true then _subject is returned UNLESS _subject is a string, in which case a new string is returned EXCEPT if no replacements are actually made, in which case the original _subject is returned.
"abcdebcd".<replace "bc" "x"/>
"axdexd"
"abcdabcd".<replace "ab" ""/>"cdcd"
<vector 1 2 3 1 2 3/>.<replace 1 9/>
<vector 9 2 3 9 2 3/>