Advertisement
Guest User

hail hitler

a guest
Nov 20th, 2017
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.27 KB | None | 0 0
  1.     public static object SplitStr(string input, int id, char c = ' ')
  2.     {
  3.         string output = "";
  4.  
  5.         string[] words = input.Split(new char[] { c });
  6.  
  7.         int i = 0;
  8.  
  9.         foreach (string s in words) {
  10.             if (i == id) {
  11.                 output = s;
  12.             }
  13.             i += 1;
  14.         }
  15.  
  16.         return output;
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement