Advertisement
rotrevrep

split string

Mar 30th, 2014
2,637
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Vala 0.28 KB | None | 0 0
  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
Add Comment
Please, Sign In to add comment
Advertisement