<< str2vec Basic functions studentize >>

Grocer >> Basic functions > strsubst_trueobj

strsubst_trueobj

replace a "true' string by another one in a string

CALLING SEQUENCE

[txt,true_obj]=strsubst_trueobj(txt,obj1,obj2,before,after,suppr_blank,opt_convstr)

PARAMETERS

Input

* vi = a string

* obj1 = a string to substitue in txt

* obj2 = the new string

* before = a string vector: what character must be found before vi

* after = a string vector: what character must be found after vi

* suppr_blank = a booelan indicating whether blanks count or not (optional: default = %f)

* convstr = a booelan indicating whether the searched object must be converted to lower case or not (optional: default = %f)

 

Output

* txt = the new txt

* true_obj = a boolean indicating whether the object has been found

DESCRIPTION

susbititue obj2 to obj1 in string txt provided it is alone or preceded by one of the characters in vector before and followed by one of the characters in vector after.

EXAMPLE

--> [newstr,truevar]=strsubst_trueobj('x+ax1-y','x','z',['+' ;'-';'*';'/';' ';'^';'('],['+' ;'-';'*';'/';' ';'^';')'])
// leads to truevar = %t and newstr = 'z+ax1-y'

AUTHOR

Éric Dubois 2015

Report an issue
<< str2vec Basic functions studentize >>