fork download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. class Program {
  5. static void Main() {
  6. string value = "I went to the store at the mall at seven thirty in a big huff.";
  7. string[] lines = Regex.Split(value, @"\s(?=to\b|at\b|in\b)");
  8.  
  9. foreach (string line in lines) {
  10. Console.WriteLine(line);
  11. }
  12. }
  13. }
Success #stdin #stdout 0.06s 34032KB
stdin
Standard input is empty
stdout
I went
to the store
at the mall
at seven thirty
in a big huff.