Advertisement
Guest User

Untitled

a guest
Jul 29th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace ConsoleApplication1
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. string test = "(a b)";
  13.  
  14. char[] splitchars = new char[] {' ', '(', ')'};
  15.  
  16. string[] splitted = test.Split(splitchars, StringSplitOptions.RemoveEmptyEntries);
  17.  
  18. Console.WriteLine(splitted.Length);
  19.  
  20. for (int i = 0; i < splitted.Length; i++)
  21. Console.WriteLine(splitted[i]);
  22.  
  23. Console.ReadLine();
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement