playMaker

Author Topic: String Condense to 1 line.  (Read 1223 times)

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
String Condense to 1 line.
« on: October 04, 2016, 10:43:19 PM »
Hi folks, I have been working on a little app for taking orders, not a game but im using playmaker :)

Bascially i have 10 strings for each "table slot" and i just add a new line to the string for each item in the tables order and then print the string at the end, simple stuff.

My problem is i cant figure out how to take all the lines in the string and condense them into 1 line.

I've tried string replace with the newline char, also tried \n, as well as hours of tinkering with other actions, String split, string format, string split to multiple strings, get substring and build string.

when i replace with just the space char, all spaces dissapear but the line breaks are still there, i have went into notepad and tried to copy and paste a linebreak char by hitting enter, selecting all then copying. - didnt work.
is there a linebreak char like \n or something similar im missing?

Im clueless now can anyone point me in the right direction?
« Last Edit: October 04, 2016, 10:52:27 PM by shinodan »

shinodan

  • Full Member
  • ***
  • Posts: 180
    • Shinozone
Re: String Condense to 1 line.
« Reply #1 on: October 05, 2016, 02:13:37 AM »
So i may have a solution but it involves completely re-doing all my fsm's :(

I opened the action i was using in mono devolop and removed the "\n" from a line of code, now it builds the strings without a new line, i can now add a special character in and replace it with the newline char that i pasted from notepad.

So summary, build the string on a single line and split it into lines, instead of building a string with a new line everytime and trying to format back to one line.