I want to find a word in a string i.e,whether a word is present in particular string or not.
String 1 Has:
Case Number
1
SKU Barcode
String 2 Has:
Case Number
I want to find whether Case Number is present in string 1 or not .
if ([string1 rangeOfString:string2].location !=NSNotFound) {
NSLog(@"matched");}
else
{ NSLog(@"not matched");}
but here i am getting not matched ...why ..And then what is the difference of using .location and .length Output:
2017-05-04 11:38:33.128495 Link[26540:17390387] String 1: Case Number
1
SKU Barcode
2017-05-04 11:38:33.129301 Link[26540:17390387] String 2: Case Number
Thanks in advance!