Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes

Change language to:
Français - 日本語 - Português

Please note that the recommended version of Scilab is 6.1.1. This page might be outdated.
See the recommended documentation of this function

Scilab help >> Strings > strsubst

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 by replaceStr in string

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')

See Also

  • string — conversion to string
  • strings — Scilab Object, character strings
<< strstr Strings strtod >>

Copyright (c) 2022-2023 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Thu May 12 11:44:27 CEST 2011