vl-string-subst

(vl-string-subst new_substring old_substring search_string [start_position])

The vl-string-subst function substitutes a character sequence within a text string for another, starting at a specified position.

Arguments

new_substring specifies the replacing text string.

old_substring specifies the text string to be replaced.

search_string specifies the text string to be evaluated.

start_position specifies the position where to begin searching within the text string (position 0 specifies the first character). If the argument is omitted, the function uses 0 for the start position.

Return Value

The return value is the value of string after any substitutions have been made. If pattern appears in string more than once, only the first substitution takes place.

Examples

: (vl-string-subst "snow" "foot" "football" 0)

"snowball"

: (vl-string-subst "2" "o" "football" 1)

"fo2tball"

: (vl-string-subst "snow" "g" "football" 0)

"football"