Good morning everyone.
I’ve got more line ending issues (http://forum.unity3d.com/viewtopic.php?t=19989).
This time, I’d like to know what the line ending character is for Strings in Unity.
I have imported a text file through the www class and have set it as .data. This returns a string of the text in the original file - which is good. However, I would like to split this string at the line endings (the original file is a csv file).
I’ve been using (just a snippet from a longer script):
var mytext = [url]www.data;[/url]
print (mytext);
var lines = mytext.Split ("\n"[0]);
print (lines);
This shows me that the text is getting imported into Unity as a string but that it is not getting split (the printed output of the lines variable in the above code shows an empty array).
My guess is that Unity is using some sort of character to end lines inside strings - but it’s not \n (nor is it \r\n, which I’ve also tried).
Any ideas?
– Anthony