SA-MP Forums Archive
Finding last number in string - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Finding last number in string (/showthread.php?tid=249029)



Finding last number in string - Pooh7 - 16.04.2011

Hi

If I have string:
Code:
Your number is: 666999
How I can find last number in string and delete it or add something after it?


Re: Finding last number in string - Babul - 17.04.2011

i suggest you to use the sscanf2 plugin for that:
Code:
new Amount;
if(sscanf(string,"{s[100]}d",Amount);
well, this will get the first number in string[] so i hope it helps a bit


Re: Finding last number in string - Pooh7 - 17.04.2011

I need last number :/


Re: Finding last number in string - Pooh7 - 17.04.2011

refresh