Last active
December 28, 2015 04:39
-
-
Save swkwon/7443938 to your computer and use it in GitHub Desktop.
string split
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string test1 = "word1:word2"; | |
string[] test1Result = test1.Split(':'); | |
foreach (string s in test1Result) | |
{ | |
Console.WriteLine(s); | |
} | |
string test2 = "word1<>word2"; | |
string[] test2Result = System.Text.RegularExpressions.Regex.Split(test2, "<>"); | |
foreach (string s in test2Result) | |
{ | |
Console.WriteLine(s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment