StringReplace

From Catglobe Wiki
Revision as of 10:11, 7 March 2011 by 127.0.0.1 (talk | contribs) (jrfconvert import)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search



stringReplace

Replaces all occurrences of a substring in a string with another string, then returns the new stringSyntaxstringReplace(main_str, old_subStr, new_subStr)Argumentsmain_str: Is a string expression.old_subStr: Is a string expression.new_subStr: Is a string expression.Return typestringExamplesstring main_str = "The fox was hunting for a rabbit.";string old_subStr = "hunting for";string new_subStr = "hunted by";string new_str = stringReplace(main_str, old_subStr, new_subStr);print(main_str);print(new_str);AvailabilityVersion 4.8