- Home /
Split string : how to automatically remove " ?
Hi,
I was wondering why the "
was counted as part of the string when we add the string into an array, and look for the first part of the string with str.Split("_"[0]);
, it gives me "Data
instead of Data
. For example :
var Me = new JSONClass();
string s = "";
for (int a = 0; a<2; a++){
for (int b = 0; b<2; b++){
s = "Data_Example";//after we split it, "_"[0] gives us : "Data
Me["data"][a][b] = s;
Me["data"][a][b] = s;
}
}
I have to add this regex to remove the "
:
string result = Regex.Replace(subStr[0], "\"", "");
Here is the link for the wiki : http://wiki.unity3d.com/index.php/SimpleJSON
Thanks
Comment
Your answer
Follow this Question
Related Questions
Loading a text document without spaces 1 Answer
How to save script component variables at runtime from IOS device? 1 Answer
Splitting a string using a string 1 Answer
split animation 1 Answer