using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication12
{
class Program
{
static void Main(string[] args)
{
SubString subStr = new SubString();
subStr.InitWithString("I am a Teacher.");
bool result = subStr.ExistSubString("am");
Console.WriteLine(result);
}
}
class SubString
{
Hashtable ht = new Hashtable();
public void InitWithString(string str)
{
string[] strArr = str.Split(‘ ‘, ‘,‘, ‘.‘);
for (int i = 0; i < strArr.Length; i++)
{
ht[strArr[i]] = true;
}
}
public bool ExistSubString(string query)
{
if (ht[query] !=null)
{
return true;
}
return false;
}
}
}