If string is "Testing for Group" then how to find if "rou" is substring.
By using method on this link
only gives complete word like substring is present or not.
like "for" in above string , but I want to find "or" , "rou" like strings present in string or not.
How to do this?
Thanks in advance.
EDIT:
my code
- (void)searchBar:(UISearchBar *)searchBar textDidChange:(NSString *)searchText
{
int count=0;
arrayGroupName=[[NSMutableArray alloc]init];
if ([searchText isEqualToString:@""])
{
arrayGroupName=permArrayGroupName;
}
else
{
while (count!=[permArrayGroupName count])
{
if ([[[[permArrayGroupName objectAtIndex:count] objectGroupName]capitalizedString] rangeOfString:[searchText capitalizedString]].location == NSNotFound )
{
NSLog(@"string does not contain bla");
}
else
{
NSLog(@"found");
[arrayGroupName addObject:[permArrayGroupName objectAtIndex:count]];
}
/*if ([[[[permArrayGroupName objectAtIndex:count] objectGroupName]capitalizedString] hasPrefix:[searchText capitalizedString]])
{
[arrayGroupName addObject:[permArrayGroupName objectAtIndex:count]];
}*/
count++;
}
}
[tableGroupList reloadData];
}