+ Reply to Thread
Results 1 to 2 of 2

Thread: NSString sub strin?

  1. #1
    Junior Member
    Join Date
    Oct 2012
    Posts
    7

    NSString sub strin?

    hi
    how to check if string contains a character like
    'ABC' contains 'A'.

  2. #2
    Junior Member
    Join Date
    Oct 2012
    Posts
    12
    following code will be used to check substring.
    Code:
    NSString yourString = @"ABC";
    if([yourString rangeOfString:@"A"].location != NSNotFound)
    {
        //contain
    }
    so if String contains substring, its location will be some integer value.

+ Reply to Thread

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts