You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 9-regular-expressions/17-regexp-methods/article.md
-7Lines changed: 0 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -232,17 +232,10 @@ O uso de uma função nos dá o poder de substituição definitivo, porque ela o
232
232
233
233
Este método é essencialmente o mesmo que `str.replace`, com duas diferenças principais:
234
234
235
-
<<<<<<<HEAD
236
235
1. Se o primeiro argumento for uma string, ele substitui *todas as ocorrências* da string, enquanto `replace` substitui apenas a *primeira ocorrência*.
237
236
2. Se o primeiro argumento for uma expressão regular sem a flag `g`, haverá um erro. Com a flag `g`, funciona da mesma forma que `replace`.
238
237
239
238
O principal caso de uso de `replaceAll` é substituir todas as ocorrências de uma string.
240
-
=======
241
-
1. If the first argument is a string, it replaces *all occurrences*of the string, while`replace` replaces only the *first occurrence*.
242
-
2. If the first argument is a regular expression without the `g` flag, there'll be an error. With `g` flag, it works the same as `replace`.
243
-
244
-
The main use case for `replaceAll` is replacing all occurrences of a string.
0 commit comments