fork(6) download
  1. using System;
  2. using System.Text.RegularExpressions;
  3.  
  4. namespace Rextester
  5. {
  6. public class Program
  7. {
  8. static void Main()
  9. {
  10. string match = "Test - Wow";
  11. MatchCollection contact = Regex.Matches(match, "-");
  12. int count = contact.Count;
  13. Match onematch = contact[0];
  14. string str = onematch.ToString();
  15. Console.WriteLine(count);
  16. Console.WriteLine(str);
  17. }
  18. }
  19. }
Success #stdin #stdout 0.06s 34128KB
stdin
Standard input is empty
stdout
1
-