mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-13 02:04:23 +02:00
correct example gsub in pt-br/awk
Edit is based on correction in the English edition.[1] [1] https://github.com/adambard/learnxinyminutes-docs/pull/4437
This commit is contained in:
@@ -202,7 +202,7 @@ function string_functions( localvar, arr) {
|
|||||||
# Ambas retornam o número de instâncias substituídas
|
# Ambas retornam o número de instâncias substituídas
|
||||||
localvar = "fooooobar"
|
localvar = "fooooobar"
|
||||||
sub("fo+", "Meet me at the ", localvar) # localvar => "Meet me at the bar"
|
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"
|
||||||
|
|
||||||
# Localiza um texto que casa com uma expressão regular
|
# Localiza um texto que casa com uma expressão regular
|
||||||
# index() faz a mesma coisa, mas não permite uma expressão regular
|
# index() faz a mesma coisa, mas não permite uma expressão regular
|
||||||
|
Reference in New Issue
Block a user