| |
subst, substall
Format:
subst ( string, pattern, replacement ) |
Format:
substall ( string, pattern, replacement ) |
Purpose:
Substitutes sub-strings of a string by other strings.
All three arguments must be strings.
subst() replaces the first occurrence of the characters
specified by the pattern
parameter in string
by the replacement parameter.
The substall() function works
the same, except that it replaces all occurrences of the
pattern.
Return Values:
Returns the string with the replacements.
Example 1:
input: | <let a="Take the ball and run with it!";
b="e ball and run with";
c="is job and shove";
d=subst(a,b,c);
? d
> | resulting output:
| Take this job and shove it! |
Example 2:
input: | <let a="v w x y z"; b=" "; c=",";
d=substall(a,b,c);
? d
> | resulting output:
| v,w,x,y,z |
See Also:
index(), substring().
This page was dynamically generated by the
web application development tool RADpage
of H.E.I.
Try the AJAX Article
(in German) on www.h-e-i.de.
© 1996-2025 H.E.I. All Rights Reserved.
|