playMaker

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

KellyRay

  • Full Member
  • ***
  • Posts: 170
Array Maker Split String to Characters
« on: August 31, 2016, 07: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: 386
    • terrivellmann.tumblr.com
Re: Array Maker Split String to Characters
« Reply #1 on: August 31, 2016, 07:45:46 PM »
have you tried the get substring action?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 7616
    • jinxtergames
Re: Array Maker Split String to Characters
« Reply #2 on: August 31, 2016, 07: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.