Jump to content
  • 0

asking about explode string


serakh00

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   4
  • Joined:  02/08/12
  • Last Seen:  

so here is my confusion :

i have a string variable

set @myvar$,"rathena";

then use explode

explode (@myvar2$,@myvar$,"")

does it copy each letter in @myvar$ into single index of @myvar2$ ?

@myvar2[0]=r

@myvar2[1]=a

@myvar2[2]=t

and so on ???

thaks before and sorry for my bad english..

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

it wont work ...it you didnt specify the delimiter...it will not break the string ..

 

CyG5vyc.jpg

 

 

 

but you can do like this ... using the charat

 

D6piiLI.jpg

Link to comment
Share on other sites


  • Group:  Developer
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  2407
  • Reputation:   613
  • Joined:  07/05/12
  • Last Seen:  

explode (@myvar2$,@myvar$,"")

does it copy each letter in @myvar$ into single index of @myvar2$ ?

Nice try xD however empty string is not a valid delimiter

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  53
  • Reputation:   4
  • Joined:  02/08/12
  • Last Seen:  

it wont work ...it you didnt specify the delimiter...it will not break the string ..

 

CyG5vyc.jpg

 

 

 

but you can do like this ... using the charat

 

D6piiLI.jpg

ok i got it

thanks emisrty..

 

 

 

 

explode (@myvar2$,@myvar$,"")

does it copy each letter in @myvar$ into single index of @myvar2$ ?

Nice try xD however empty string is not a valid delimiter

 

haha i though it will explode each letter even if delimiter is empty

Edited by serakh00
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...