0
Well, I have the following code:
<script type="text/javascript">
var mao1 = "goncalo1";
var mao2 = 1;
var mao3 = mao1+mao2;
window.alert(mao3);
</script>
What I intended was that var mao3, showed goncalo2 and not goncalo11, how can I do this?
To do this you will need to separate the number from your string, there are a thousand ways to do this, what is your main goal with this?
– felipekm
I knew, that there was a Function that did this, I just can’t remember which.
– Gonçalo
What are the possible strings? Any input pattern? Numbers in the middle of the string should also be summed?
– MarceloBoni