Parameter description
Findstring target string
Required. specifies a string value to find.
Perform a global search Add a 'G' flag to this parameter and to perform
Case-insensitive search add an 'I'
Flag
Required. Specify the string to be replaced. To perform multiple matching, you need to add a "G" tag. To specify fuzzy match, you need to add an "I" mark
Newstring
Required. specifies the string to replace the found value
From findstring
Required. New Value of the string to be replaced
You can refer to the following implementation for all replacement:
1
VaR teststr =
"Aaabbbcccdddaaa ";
Alert (teststr. Replace (/A/G, 'x '));
Replace all A in the string teststr with x
2
Stringobj. Replace (New
Regexp (oldstring, "GM"), newstring ))
Note:
G of GM indicates global,
M indicates multiline, which can replace all specified strings.
3
VaR teststr =
"Aaabbbcccdddaaa ";
STR = Str. Split ("A"). Join ("X ");
Alert (STR)
;
Replace all A in the string teststr with x
Reference: http://wangyi878750.blog.sohu.com/31370032.html