以下是命令参考
1.subinstr(s1,s2,s3,n)
Description:s1, where the first n occurrences in s1 of s2 have been replaced with s3
subinstr() is intended for use with only plain ASCII characters and for use by programmers who want to perform byte-based substitution. Note that any Unicode character beyond ASCII range (code point greater than 127) takes more than 1 byte in the UTF-8 encoding; for example, é takes 2 bytes.
To perform character-based replacement in Unicode strings, see usubinstr().
If n is missing, all occurrences are replaced.
Also see regexm(), regexr(), and regexs().
subinstr("this is the day","is","X",1) = "thX is the day"
subinstr("this is the hour","is","X",2) = "thX X the hour"
subinstr("this is this","is","X",.) = "thX X thX"
Domain s1:strings (to be substituted into)
Domain s2:strings (to be substituted from)
Domain s3:strings (to be substituted with)
Domain n: integers > 0 or missing
Range:strings
2.subinword(s1,s2,s3,n)
Description: s1, where the first n occurrences in s1 of s2 as a word have been replaced with s3
A word is defined as a space-separated token. A token at the beginning or end of s1 is considered space-separated. This is different from Unicode word, which is a language unit based on either a set of word-boundary rules or dictionaries for several languages (Chinese, Japanese, and Thai). If n is missing, all occurrences are replaced.
Also see regexm(), regexr(), and regexs().
subinword("this is the day","is","X",1) = "this X the day"
subinword("this is the hour","is","X",.) = "this X the hour"
subinword("this is this","th","X",.) = "this is this"
Domain s1:strings (to be substituted for)
Domain s2:strings (to be substituted from)
Domain s3:strings (to be substituted with)
Domain n: integers > 0 or missing
Range:strings
Remarks
Use function usubinstr() if your string contains Unicode characters.