Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi, i want to scan this string

"hello i am emp 1313 object of string class 123"

so in this i want to know if their are any integer value present and if present i want to display them for this i am using the NSScanner class and heres a view of my code

NSString *str = @" hello i am emp 1313 object of string class 123";

    NSString *limit = @" object";
    NSScanner *scanner = [NSScanner scannerWithString:str];

    int i;
    [scanner scanInt:&i];
    NSString *output;
    [scanner scanUpToString:limit intoString:&output];
    NSLog(@"%d",i);



but the problem is that i am not able to do it and i want to use NSScanner class only so can you experts give me some suggesstions regarding this.....
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900