fork download
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text.RegularExpressions;
  4. using System.Linq;
  5. public class Test
  6. {
  7. public static void Main()
  8. {
  9. var str = "Word1_Word2_WORD3-maybe_Word4 Word1_Word2_WORD3 Word1_Word2_WORD3-maybe_Word4_Word5";
  10. var res = str.Split().Any(s => s.Count(f => f == '_') == 3);
  11. Console.WriteLine(res ? "Valid" : "Invalid");
  12. }
  13. }
Success #stdin #stdout 0.01s 131648KB
stdin
Standard input is empty
stdout
Valid