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

  • SEARCH
  • Home
  • 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 7907533
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T11:29:27+00:00 2026-06-03T11:29:27+00:00

I have a project where I am trying to grab text from a uilabel

  • 0

I have a project where I am trying to grab text from a uilabel that has been populated from a web service. I can grab and manipulate the text just fine but I need to send certain characters from the string to another web service call. I can not figure out how to grab the first, second and last characters in my string. I am both new to Objective-C as well as programming so any help would be much appreciated.

  • 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-03T11:29:30+00:00Added an answer on June 3, 2026 at 11:29 am

    You can do it like this:

    UILabel * l = [[UILabel alloc] init];
    l.text = @"abcdef"; //set text to uilabel
    [self.view addSubview:l];
    
    NSString * text = l.text; //get text from uilabel
    unichar first = [text characterAtIndex:0]; //get first char
    unichar second = [text characterAtIndex:1];
    unichar last = [text characterAtIndex:text.length -1];
    

    If you need results as strings you can use:

    NSString * firstAsString = [text substringWithRange:NSMakeRange(0, 1)]; //first character as string
    

    or you can convert the unichar to string like this:

    NSString * x = [NSString stringWithFormat:@"%C", last]; 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a project that has alot of file manipulation. I am trying out
I have a project that I am trying to convert to OSGi. However, this
I have been working on a project and trying to understand how these components
I have a Website project that I'm trying to debug using Fiddler. Fiddler doesn't
I have a project where we are trying to skin Spark components from a
I've been trying to develop an application with Netbeans RCP to grab images from
I have been trying to make a user login page that, when the user
I'm trying to grab my project and generate an Archetype from it via :
I have an ARC project and am trying to draw a vertical linear gradient.
I have a project where we are trying to get the code space down.

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.