[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
gsub(r,s) global substitution
Substitute s for strings matched by r globally in $0. Return number of
substitutions made. The operator '$$0' or the character '&' will be
replaced in the substitution string by the the sub-string matched. For
Example:
$0 = "The occurrence of any filename"
gsub(/\s+/,"\t") ==> $0 = "The\toccurrence\tof\tany\tfilename"
gsub(r,s,t) global substitution
Substitute s for strings matched by r globally in t. Return number of
substitutions made. The operator '$$0' or the character '&' will be
replaced in the substitution string by the the sub-string matched. For
example to remove punctuation and parenthesis:
t = "The best, of which he was capable, (considering";
gsub(/({_p}|{_b})+/,"",t)
==> t == "The best of which he was capable considering"
See Also:
sub
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson