Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8770915
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T17:39:23+00:00 2026-06-13T17:39:23+00:00

In my iPhone app i have an array of stings. fron that string i

  • 0

In my iPhone app i have an array of stings.

fron that string i need to get the array of first charecters. For this i have implemented logic as follow. it works but in this i have retrieve charectes twicw 1.Small letters and 2.Capital letters.

I need to get only capital letters even it is the small letter.

like Only “A” for America, Africa and america, antantica

contactIndex = [[NSMutableArray alloc] init];

      for (int i=0; i<[contactsArray count]-1; i++){
            //---get the first char of each state---
            char alphabet = [[contactsArray objectAtIndex:i] characterAtIndex:0];
            NSString *uniChar = [NSString stringWithFormat:@"%C", alphabet];

            //---add each letter to the index array---
            if (![contactIndex containsObject:uniChar])
            {            
                  [contactIndex addObject:uniChar];
            }        
      }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T17:39:24+00:00Added an answer on June 13, 2026 at 5:39 pm

    See the Example, This will work

    NSMutableArray *contactsArray = [[NSMutableArray alloc] initWithObjects:@"America",@"Africa",@"america",@"antantica", nil];    
    
    for (int i=0; i<[contactsArray count]; i++){
    
            NSString *alphabet = [[contactsArray objectAtIndex:i] uppercaseString];
    
            NSString *firstCharactor = [alphabet substringToIndex:1];
    
           [contactIndex addObject:firstCharactor];
    
            NSLog(@"%@",firstCharactor);
    
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this iPhone app that has an array containing around 50 to 100
I have an iPhone app with an array of objects that I want to
I want to have a global array/variable in an iPhone app that uses storyboard.
I have an iPhone app that used to use an array of several thousand
I have a UIWebView in my iPhone app that have a web page with
I am building an iPhone app and I have implemented a section for knowledge
I'm creating an iPhone app that will have a preloaded set of locations with
I have an app which existed as an iPhone app first and now as
I currently have an iPhone app that lets the users take video, upload it
I have an iPhone app that I've built for the app store. Before I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.