SA-MP Forums Archive
Need help with strings. - 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)
+--- Thread: Need help with strings. (/showthread.php?tid=338590)



Need help with strings. - xOFxK1LLER - 30.04.2012

Hi,

I wanted to ask how i could split my string. For example: The string looks like this: Test1 | Test 2 | Test 3 | etc..
So i want to split this string. Everytime it finds an "|" it should return the text before the "|".

So it would look like this:

SendClientMessage(playerid, COLOR, "Test1");
SendClientMessage(playerid, COLOR, "Test2");
SendClientMessage(playerid, COLOR, "Test3");

etc..

Hope you can help me.


Re: Need help with strings. - Finn - 30.04.2012

https://sampwiki.blast.hk/wiki/Code_Snippets#Split


Re: Need help with strings. - SuperViper - 30.04.2012

pawn Код:
sscanf(stringName, "p<|>s[length]s[length]s[length]", var1, var2, var3);