playMaker

Author Topic: Split string into individual characters [Solved]  (Read 141 times)

LuminRabbit

  • Full Member
  • ***
  • Posts: 151
  • Lumin Rabbit
    • View Profile
Split string into individual characters [Solved]
« on: November 14, 2020, 06:42:07 PM »
Hi,

I figured this out before but can't seem to figure it out again and need some help.
I want to split a string into individual characters: "hello"

output would be:
h
e
l
l
o

What I have so far, the first state gets the String Length (5)
2nd state, iterate (start index 1, end index stringLength)
3rd state that is looped to Get String Left or Get Substring and an Array List Add
4th state Finished Event.

The output in the array is:
h
he
hel
hell
hello

Im using ArrayMaker and probably missing something simple I just can't see it, any help would be greatly appreciated!
« Last Edit: November 15, 2020, 12:57:59 PM by Kodagames »
Have I said how much I love playmaker!!! This is one amazing tool

Broken Stylus

  • Hero Member
  • *****
  • Posts: 526
    • View Profile
Re: Split string into individual characters
« Reply #1 on: November 15, 2020, 06:54:49 AM »
String Split or Split Text To Array actions.
You might also parse a string manually by increasing the integer value for the starting character in actions such as Get String Left/Right or Get Substring.

LuminRabbit

  • Full Member
  • ***
  • Posts: 151
  • Lumin Rabbit
    • View Profile
Re: Split string into individual characters
« Reply #2 on: November 15, 2020, 09:33:47 AM »
Awesome Finally :D

Using the Get SubString Action, I needed to increase the Start Index each loop but this int needed to be a different int from the others (index or stringCount, because those ints are doing something else, so create an int that just increases each loop(anything)). Also the Get Substring Length needed to be 1 (one character).

So easy to overlook stuff (Just need to be more patient and really think about what's going on). Yay!
« Last Edit: November 21, 2020, 10:29:43 AM by Kodagames »
Have I said how much I love playmaker!!! This is one amazing tool