correct example about gsub

This corrects an error spot in the English edition of the document
spot earlier[1] and equally present in the French one.

[1] https://github.com/adambard/learnxinyminutes-docs/pull/4437
This commit is contained in:
Norwid Behrnd 2022-07-11 14:12:16 +02:00
parent 1ff2927250
commit b20081e0f8

View File

@ -199,7 +199,7 @@ function string_functions( localvar, arr) {
# Les deux renvoient le nombre de correspondances remplacées
localvar = "fooooobar";
sub("fo+", "Meet me at the ", localvar); # localvar => "Meet me at the bar"
gsub("e+", ".", localvar); # localvar => "m..t m. at th. bar"
gsub("e", ".", localvar); # localvar => "m..t m. at th. bar"
# Rechercher une chaîne de caractères qui correspond à une expression régulière
# index() fait la même chose, mais n'autorise pas les expressions régulières