Jump to content
  • 0

How do I use 'space' as delimiter for the 'explode' script


Question

Posted

I need to deliminate an input with space. How do I do that? " " does not work

*explode(<dest_array>,<string>,<delimiter>)

Breaks a string up into substrings based on the specified delimiter. Substrings
will be stored within the specified string array. Only the 1st char of the
delimiter parameter will be used. If an empty string is passed as a delimiter,
the string will be placed in the array in its original form.

Example:
    explode(.@mapwarp$, @input$, ",");
    //.@my_array$ contents will be...
    //.@my_array$[0]: "Explode"
    //.@my_array$[1]: "Test"
    //.@my_array$[2]: "1965"
    //.@my_array$[3]: "red"
    //.@my_array$[4]: "PIE"

 

 

1 answer to this question

Recommended Posts

  • 0
Posted

I just tried this code:

explode(.@mapwarp$, "Hola y adios", " ");
        mes .@mapwarp$[0];
        mes .@mapwarp$[1];
        mes .@mapwarp$[2];

And it gives:

image.png.910729766db63924765d28b4de115458.png

So it works fine, you can delimitate using space.

¿Can you show your code?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...