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 465697
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T23:24:13+00:00 2026-05-12T23:24:13+00:00

Gotten a hold on how to fetch and write to variables in Objective-C, now

  • 0

Gotten a hold on how to fetch and write to variables in Objective-C, now it’s time to learn how to do something more useful with them! Right now, I’m primarily trying to figure out how string manipulation works. In particular, I’m looking for the following functions:

  • Concatenation
  • Finding the length of a string (especially multi-byte/UTF-8 strings; I do a lot of work with East Asian languages)
  • Pulling just a portion of a string (e.g. the “foobar” out of “abcfoobarxyz”)
  • Searching within a string (see the above example)
  • Changing case (upper, lower, title if it’s simple to do)
  • Exploding/Imploding strings (e.g. creating and getting information from comma-separated lists)
  • Find/Replace within strings
  • Any other generally useful string functions that might be available
  • 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-05-12T23:24:14+00:00Added an answer on May 12, 2026 at 11:24 pm

    Examples:
    Concatenation:

    - (NSString*) concatenateString:(NSString*)stringA withString:(NSString*)stringB
    {  
        NSString *finalString = [NSString stringWithFormat:@"%@%@", stringA,
                                                           stringB];
        return finalString;
    }
    // The advantage of this method is that it is simple to put text between the
    // two strings (e.g. Put a "-" replace %@%@ by %@ - %@ and that will put a
    // dash between stringA and stringB
    

    String Length:

    - (int) stringLength:(NSString*)string
    {
        return [string length];
        //Not sure for east-asian languages, but works fine usually
    }
    

    Remove text from string:

    - (NSString*)remove:(NSString*)textToRemove fromString:(NSString*)input
    {
       return [input stringByReplacingOccurrencesOfString:textToRemove
                                               withString:@""];
    }
    

    Uppercase / Lowercase / Titlecase:

    - (NSString*)uppercase:(NSString*)stringToUppercase
    {
       return [stringToUppercase uppercaseString];
    }
    
    - (NSString*)lowercase:(NSString*)stringToLowercase
    {
       return [stringToLowercase lowercaseString];
    }
    
    - (NSString*)titlecase:(NSString*)stringToTitleCase
    {
       return [stringToTitleCase capitalizedString];
    }
    

    Find/Replace

    - (NSString*)findInString:(NSString*)string
            replaceWithString:(NSString*)stringToReplaceWith
    {
       return [input stringByReplacingOccurrencesOfString:string
                                               withString:stringToReplaceWith];
    }
    

    I hope this helps!

    PS: Don’t forget to check the documentation, and Google is your friend. Good luck

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've gotten a hold of Python Imaging Library (PIL) and installed the PNG support
We're neck deep in a project right now, schedules are tight (but reasonable). Our
I started an application in Google App Engine right when it came out, to
I work at company X and we want to engage in a B2B transaction
Okay, so I'm working on an iPhone app with a preferences-esque section where there's
I have the following code in Python: def point_to_index(point): if point not in points:
I have a simple jquery script as follows: $('a').click(function() { //get the id of
Being new to Ada, I'm exploring its syntax and rules and I would like
One thing that seems particularly easy to do in the Flash IDE but difficult

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.