You can try the following solution
void Main()
{
string str1 = "This is first test string";
string str2 = "first test for me";
string stringToFind=str2;
int spaceIndex;
while (true){
if (str1.Contains(stringToFind)){
Console.WriteLine("Str1 contains: " + stringToFind);
break;
}
spaceIndex=stringToFind.LastIndexOf(' ');
if(spaceIndex==-1)
break;
stringToFind = stringToFind.Substring(0,spaceIndex).Trim();
}
}
If your problem is solved you may accept the solution, otherwise please post your queries.
PES