How do I parse this string in C# so I can break it up into separate variables?
I tried this but it did not work.
string[] parts = www.downloadHandler.text.Split('|');
string guid = (parts[0]);
string username = (parts[1]);
int health = int.Parse(parts[2]);
int level = int.Parse(parts[3]);
int points = int.Parse(parts[4]);
int killBonus = int.Parse(parts[5]);
float killRate = float.Parse(parts[6]);
float kills = float.Parse(parts[7]);
float misses = float.Parse(parts[8]);
This is in the UnityWebRequest getting the "www.downloadHandler.text from the php file on the server.
How can I get these values separately and not in one string?
Here is the PHPcode echo.
echo ("GUID: ".$row['GUID']. PHP_EOL. "|Name: ".$row['userName']. PHP_EOL. "|Health: ".$row['health']. PHP_EOL. "|level: ".$row['level']. PHP_EOL. "|Points: ".$row['points']. PHP_EOL. "|Kill Bonus: ".$row['killBonus']. PHP_EOL. "|Kill Rate: ".$row['killRate']. PHP_EOL. "|Kills: ".$row['kills']. PHP_EOL. "|Misses: ".$row['misses']. PHP_EOL. ";");