mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-04-27 07:33:57 +00:00
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:
parent
1ff2927250
commit
b20081e0f8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user