Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: djaydino on June 06, 2016, 06:18:46 AM

Title: string split (the official Action) '\n' does not seem to work properly
Post by: djaydino on June 06, 2016, 06:18:46 AM
Hi,
It seems that string split does not work properly.

I am getting data from a website as 'pipe' into a string this is the result.

Code: [Select]
oneil|1399|0||6/2/2016 12:50:42 PM|0
shreck|1344|0||6/2/2016 12:50:55 PM|1
jack|1200|0||6/2/2016 12:49:54 PM|2
jill|1199|0||6/2/2016 12:50:06 PM|3
bif|900|0||6/2/2016 12:49:47 PM|4
groot|800|0||6/2/2016 12:49:40 PM|5
ikke|500|0||6/2/2016 12:49:28 PM|6
dino|200|0||6/2/2016 12:49:21 PM|7
Carmine|100|0||6/2/2016 12:49:13 PM|8
ruiter|48|0||6/2/2016 3:24:51 PM|9

Then i want to split each line. But i get this as a result :

(http://s33.postimg.org/w30jiyp8v/Capture.jpg)
Title: Re: string split (the official Action) '\n' does not seem to work properly
Post by: jeanfabre on June 07, 2016, 03:22:12 AM
Hi,

 it's fine, it's just that you need to copy paste a return char from a text editor back into the Separators property, else if you have "\n" it will split using [\] and [n] which is why you get the weird output, all characters n are used as a split.

However, it's a hot topic atm it seems, so I did two new actions on the Ecosystem, GetNewLineCharacter and GetTabCharacter, just for convenience.

https://twitter.com/JeanAtPlayMaker/status/740081134760034304

 Bye,

 Jean
Title: Re: string split (the official Action) '\n' does not seem to work properly
Post by: djaydino on June 07, 2016, 05:48:56 AM
Hi,
Maybe explaining it better in the tooltip will help.
As what i understood i had to place '\n'