- Aide Scilab
- Chaînes de caractères
- eval
- evstr
- string
- ascii
- blanks
- code2str
- convstr
- emptystr
- grep
- isalphanum
- isascii
- isdigit
- isletter
- isnum
- justify
- length
- part
- regexp
- sci2exp
- str2code
- strcat
- strchr
- strcmp
- strcmpi
- strcspn
- strindex
- strings
- stripblanks
- strncpy
- strrchr
- strrev
- strsplit
- strspn
- strstr
- strsubst
- strtod
- strtok
- tokenpos
- tokens
- tree2code
Please note that the recommended version of Scilab is 2025.0.0. This page might be outdated.
See the recommended documentation of this function
strsubst
substitute a character string by another in a character string.
Calling Sequence
string_out=strsubst(string_in,searchStr,replaceStr) string_out=strsubst(string_in,searchStr,replaceStr,[flag])
Arguments
- string_in
a matrix of character string. The strings where to search occurrences of
searchStr
- searchStr
A character string. The string to search in
string
.- replaceStr
A character string. The replacement string.
- str_out
A matrix of character strings. The result of the substitution on
searchStr
byreplaceStr
instring
- flag
string("r" for regular expression)
Description
strsubst
replaces all occurrences of
searchStr
in string
by
replaceStr
.
When using the forth parameters "r", the searchStr should be a string of regular expression. And then strsubst is going to match it with string and replace according to the regular express rules.
Examples
strsubst('SCI/demos/scicos','SCI','.') strsubst('SCI/demos/scicos','/',' ') strsubst('2' ,'/2(]*)?$\1/' ,'0','r')
<< strstr | Chaînes de caractères | strtod >> |