vl-string-subst


(vl-string-subst newStr oldStr string [ fromPos ] )

This function replaces the first occurrence of oldStr by newStr in string.

Arguments

newStr  (string) replacement string for oldStr
oldStr  (string) string to be replaced by newStr
string  (string)  string where oldStr is to be replaced by newStr
fromPos  (integer, optional) specifies the start index in string; if omitted, 0 is used (search from string start)

Return

(string) the result of string substitution

Example

(vl-string-subst "xxx" "a" "a b c b a")  returns "xxx b c b a"

Remarks

only the first occurrence of oldStr is replaced by newStr !
string replacement works in case-sensitive way;
first character position/index in string is at index 0



©  Bricsys NV. All rights reserved.