Advertisement
rotrevrep

split string

Mar 30th, 2014
1,136
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. string[] split_string (string str, string delimiters)
  2. {
  3.     Gee.ArrayList<string> list = new Gee.ArrayList<string>();
  4.     string token = Posix.strtok (str, delimiters);
  5.     while (token != null)
  6.     {
  7.         list.add (token);
  8.         token = Posix.strtok (null, delimiters);
  9.     }
  10.     return list.to_array();
  11. }
Advertisement
RAW Paste Data Copied
Advertisement