-2
I have the following function, which changes the numeric value of a string when found:
var original = "Este aqui é o valor do cliente 000.000.00 01";
var original = str.match(/\d\d\d\.\d\d\d\.\d\d \d\d/)
var novo = "129.000.000 02";
original = original.replace(/\d\d\d\.\d\d\d\.\d\d \d\d/g, novo);
What I need to do is that when it finds and changes the numeric value the final 2 numbers it keeps the original string. In the case up there, it would be like this:
Upshot = 129.000.000 02
What I need:
Upshot = 129.000.000 01
(that 01
would be the last 2 digits of the original string)
I swear I tried, but I can’t understand what you need, try to put more context
– felipekm
rsrssrs @Felipekm that was good. Come on, I’ll be practical.
– user7605
@Felipekm, I edited the question, see if you understand.
– user7605