반응형
- Substring
string myString = "Hello World!";
string subString = myString.Substring(6, 5);
Debug.Log(subString); // Output: "World"
- Split
string myString = "Hello, World!";
string[] substrings = myString.Split(',');
// Output: "Hello", " World!"
- Replace
string myString = "Hello World!";
string replacedString = myString.Replace("Hello", "Hi");
Debug.Log(replacedString); // Output: "Hi World!"
- IndexOf
string myString = "Hello World!";
int index = myString.IndexOf("World");
Debug.Log(index); // Output: 6
- Trim
string myString = " Hello, World! ";
string[] substrings = myString.Trim().Replace(",", "").Split(' ');
// Output: "Hello", "World!"
반응형