playMaker

Author Topic: Array Maker Split String to Characters  (Read 322 times)

KellyRay

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Array Maker Split String to Characters
« on: August 31, 2016, 04:25:10 PM »
Hey friends,

I'm attempting to split a string like "word" into individual characters and then add them into to an array maker array.

I'm looking at the split text, but this is really handy for lists of words that have clear dividers. How can you pull this off with a single long string?

Thanks!

terri

  • Sr. Member
  • ****
  • Posts: 348
    • View Profile
    • terrivellmann.tumblr.com
Re: Array Maker Split String to Characters
« Reply #1 on: August 31, 2016, 04:45:46 PM »
have you tried the get substring action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 2260
    • View Profile
    • jinxtergames
Re: Array Maker Split String to Characters
« Reply #2 on: August 31, 2016, 04:49:00 PM »
Hi,
you can try this :
There is a custom action on the Ecosystem called iterate it is mainly used to loop.

Get the length of the string then use this on the iterate end index, leave increment to 1 and store the current index.

in the next state use "get string left" and use the "current index" on the char count. then use array add and then loop the state back to iterate,

add another state for when iterate is done.

It is possible that you need to set the start index to 1 on the iterate and / or add 1 to the string length i can't test this atm

If you don't understand what i mean, let me know so i will make a quick video to explain.