コード
文字列でsplit
string str = "1234 1234 unko 123 1131"; string[] splitStr = {"unko"}; string[] ary = str.Split(splitStr, StringSplitOptions.None); Debug.Log(ary.Length);//2 Debug.Log(ary[0]);//1234 1234 Debug.Log(ary[1]);// 123 1131
改行でsplit
string[] brStr = {"\n"}; string[] lines = suuji.Split(brStr, StringSplitOptions.None); Debug.Log(lines.Length); Debug.Log(lines[1]); Debug.Log(lines[2]); Debug.Log(lines[3]);