im having a bit of trouble with my code and im in need of suggestions.This may seem simple to you guys so im sorry for that.I need to compare the string v to string s and see how many times a combination of either aa,ee,ea,ae matches the string v and count the results.
What i have so far is this :
int main (int argc, const char * argv[])
{
NSString *s = @"aebeee";
NSString *v =@"ae";
NSInteger length = v.length -1 ;
BOOL isGrup = FALSE;
for ( int i= 0 ; i<length; i++) {
if([s characterAtIndex:i] == [v characterAtIndex:0 ]){
isGrup = TRUE;
}
if(isGrup ==1)
{
NSLog(@" is equal");
}else{
NSLog(@" is not equal");
}
}
return(0);
}
I know i should delete the code after isGrup = TRUE; but i only did that to test and see if the results match so far.As you see it works but this only works for one char, how do i make it go to the next one and count my results?