using System;
using System.Linq;
public class Test
{
public static void Main()
{
string str = "Lorem ipsum is great.Loremocountsalso lorem ipsum Lorem...";
String searchWhat = "Lorem";
int count = str.Split(new[]{' ','.'},StringSplitOptions.None)
.Count(w => w.Contains(searchWhat));
Console.Write("Count={0}",count);
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uTGlucTsKcHVibGljIGNsYXNzIFRlc3QKewoJcHVibGljIHN0YXRpYyB2b2lkIE1haW4oKQoJewoJCXN0cmluZyBzdHIgPSAiTG9yZW0gaXBzdW0gaXMgZ3JlYXQuTG9yZW1vY291bnRzYWxzbyBsb3JlbSBpcHN1bSBMb3JlbS4uLiI7CiAgICAgICAgU3RyaW5nIHNlYXJjaFdoYXQgPSAiTG9yZW0iOwogICAgICAgIGludCBjb3VudCA9IHN0ci5TcGxpdChuZXdbXXsnICcsJy4nfSxTdHJpbmdTcGxpdE9wdGlvbnMuTm9uZSkKICAgICAgICAgICAgICAgICAgICAgICAuQ291bnQodyA9PiB3LkNvbnRhaW5zKHNlYXJjaFdoYXQpKTsKICAgICAgICBDb25zb2xlLldyaXRlKCJDb3VudD17MH0iLGNvdW50KTsKCX0KfQ==