Page 1 of 1

An very easy question about function come in!

Posted: Tue Feb 07, 2006 2:23 pm
by netfriends
Is PB has the same function like "split()" in VB ?

vb code

Code: Select all

dim array_1() as string
array_1()=split("qqw|wwq|wqw","|")
debug.print array_1(1)
return "wwq"

how is PB code written?

Posted: Tue Feb 07, 2006 2:40 pm
by Dare2
Hi netfriends,

PureBasic does not have a split function. But you can do something similar:

Code: Select all

sourceStr.s = "qqw|wwq|wqw"
n = CountString(sourceStr, "|")
Dim Arr.s(n)
For i = 0 To n
  Arr(i) = StringField(sourceStr, i + 1, "|")
Next
For i = 0 To n
  Debug Arr(i)
Next

Posted: Tue Feb 07, 2006 3:14 pm
by netfriends
Dare2

Thanks a lot :)

Posted: Tue Feb 07, 2006 3:18 pm
by freedimension
netfriends signature wrote:If the chinese forum is created...
I hope so
Don't hope, ...
... do it yourself ;)

Someone has to be the first, the rest will follow.

BTW: Where from china are you? I'm just curious :)

Posted: Tue Feb 07, 2006 3:32 pm
by netfriends
Hi freedimension
Those just to say ... :D Dn't be cared

Some mouths ago ,I have a website too, Because of $ and school work and so on ~ HEHE It was closed

If more an more chinese want to learn ,PB I will to found the BBS :)