playMaker

Author Topic: String Split  (Read 1456 times)

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
String Split
« on: January 26, 2015, 08:20:15 AM »
Split a string at each divider character and store the results into separate strings.

Limitations:
Number of result strings must be known. Error detection will throw if the input string has more segments than the storing capacity. No error if there are fewer strings, so essentially a maximum number of segments is what you are defining.

Also on Ecosystem.

600

  • Sr. Member
  • ****
  • Posts: 493
    • View Profile
    • Car and Traffic Playmaker assets
Re: String Split
« Reply #1 on: January 26, 2015, 09:55:36 AM »
Yes!

Thanks!!

nick_h82

  • Playmaker Newbie
  • *
  • Posts: 36
    • View Profile
Re: String Split
« Reply #2 on: January 27, 2015, 02:26:35 AM »
You're a legend! I was just formulating this question and you've written an action. Just after the same happened with your average vector3 action. Cheers Lane!

4arrancho

  • Playmaker Newbie
  • *
  • Posts: 19
    • View Profile
Re: String Split
« Reply #3 on: August 03, 2015, 04:42:06 PM »
What's the divider symbol for string with break lines

For example if i have this string
"line 1
 line 2
 line 3"

and wanna split it into
string 1 : "line 1"
string 2 : "line 2"
string 3 : "line 3"

I tried \n and didn't work...

thanks!

Lane

  • Administrator
  • Hero Member
  • *****
  • Posts: 2484
  • Yup.
    • View Profile
    • Cleverous
Re: String Split
« Reply #4 on: August 03, 2015, 05:18:26 PM »
I don't think you can do linebreaks with this action. Get a valid character for it to recognize in there.