Is there any way to split?
#1

In Python language there is function that called:
.split
What does this do is(if we have this sentence):
GG[80] = "HeyHeyHeyHeyHey"
so that function can split and give it:
GG[0] = "Hey"
GG[1] = "Hey"
GG[2] = "Hey"
etc...
Is there any way to do it in samp ?
Reply
#2

Nevermind, I misunderstood.
Reply
#3

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
https://sampwiki.blast.hk/wiki/Strcat

I’m pretty sure this is what you’re looking for.
Not this what I'm searching for...
Reply
#4

Quote:
Originally Posted by Osamakurdi
Посмотреть сообщение
Not this what I'm searching for...
The only function I could think of that’s like this would be:

https://sampwiki.blast.hk/wiki/Strmid
Reply
#5

Quote:
Originally Posted by CantBeJohn
Посмотреть сообщение
The only function I could think of that’s like this would be:

https://sampwiki.blast.hk/wiki/Strmid
Okay I need a function that split string every something for example I have this string:
"Hello * Man"
so if i use a function for example called split. so it can be used like:
split("Hello", *);
so its can give me 2 strings
first string is : Hello
seconds string is : MAN..
Reply
#6

Read about sscanf.
Reply
#7

sscanf would be possible but isn't perfect as it expects a certain amount of Strings (split can operate on any amount of sub-strings within the limit (at least in PAWN there must be a limit)).

https://sampforum.blast.hk/showthread.php?tid=362764 - strlib by Slice

The function "strexplode" is what you are looking for. This Include also has a lot of other very useful string functions.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)