I've text file like the one below:
C 0.000 1.397 -0.004
C 1.209 0.700 0.001
C 1.210 -0.698 0.004
I've done this code for it
string path = EditorUtility.OpenFilePanel("Molenity","","txt");
var contents = File.ReadAllLines(path);
for (int i = 2; i < contents.Length; i++)
{
string[] words = contents[i].Split(' ');
Replace(" ",""); // Thats what I've added as a solution but not working.
string type = words[0];
float x = float.Parse(words[1]);
float y = float.Parse(words[2]);
float z = float.Parse(words[3]);
}
Some other text files can have more spaces like the one below:
C 0.000 1.397 -0.004
C 1.209 0.700 0.001
C 1.210 -0.698 0.004
What I've to do is to ignore those white empty spaces, is there any solutions?