- Home /
Getting String From WWW
Hello Everyone
i got problem in Getting String/Text from PHP File on Internet
public void GetGameName(string user){
WWWForm www = new WWWForm();
www.AddField("user",user);
WWW w =new WWW("http://www.MyData.dx.am/GetGameName.php",www);
StartCoroutine(GameName(w));
}
IEnumerator GameName(WWW w){
yield return w;
if(w.error == null){
Debug.Log(w.text);
Debug.Log(w.text.ToString());
}
else{
Debug.Log("Error: " + w.error.ToString());
}
}
That PHP File , Contain Word "Bullet" but its not showing in Unity3d
in the Debug.log Show Up :
GameName :
BulleT
UnityEngine.Debug:Log(Object)
<GetGameName>c__Iterator3:MoveNext() (at Assets/MultiPlayer/Inted.cs:59)
so how i can only get the "BulleT" Word not all of this
Sorry For my Bad English -Thanks
Comment
Best Answer
Answer by D3m0nE · Sep 21, 2013 at 08:37 AM
SOLVED
i Used
string MyName = w.text;
string RemoveStart = MyName.TrimStart();
string RemoveEnd = RemoveStart.TrimEnd();
Debug.Log (RemoveEnd);
Answer by DaveA · Sep 21, 2013 at 08:26 AM
Looks like it's working as intended. Unity's debug log will print the string, but it also prints the context in which that line was printed. I don't think you can turn that off.