Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- string pattern = @"^(\w)(?:(?:,(\w))*)$";
- List<char> list = new List<char>();
- foreach(Match m in Regex.Matches(s, pattern))
- {
- string msg = "";
- for(int i = 1; i < m.Groups.Count; i++)
- {
- Group g = m.Groups[i];
- if(g.Value != "")
- {
- Debug.Log(g.Value[0]);
- list.Add(g.Value[0]);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment