fork download
  1. using System;
  2. using System.Linq;
  3. public class Test
  4. {
  5. public static void Main()
  6. {
  7. string str = "Lorem ipsum is great.Loremocountsalso lorem ipsum Lorem...";
  8. String searchWhat = "Lorem";
  9. int count = str.Split(new[]{' ','.'},StringSplitOptions.None)
  10. .Count(w => w.Contains(searchWhat));
  11. Console.Write("Count={0}",count);
  12. }
  13. }
Success #stdin #stdout 0.05s 37136KB
stdin
Standard input is empty
stdout
Count=3