0
Hello how can I replace some part of my link with JS example
https://meusite.com.br/arquivos/ids/785837-90-90/arquivo
I need to trade the 2 "90" for "160"
0
Hello how can I replace some part of my link with JS example
https://meusite.com.br/arquivos/ids/785837-90-90/arquivo
I need to trade the 2 "90" for "160"
0
You can use the replace
let url = 'https://meusite.com.br/arquivos/ids/785837-90-90/arquivo'
let newUrl = url.replace(/90/g, '160')
console.log(newUrl)
Browser other questions tagged javascript
You are not signed in. Login or sign up in order to post.
Just replace? Maybe Function
replace
help: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace– Ricardo Pontual
Only with the information you indicate does not work for other numbers, or will it always be just
90
?. It would be better to give more examples of substitutions you want to do in order to identify a pattern– Isac