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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T06:45:21+00:00 2026-05-31T06:45:21+00:00

I am having a string as follows NSString str1 = @Hello your bal =

  • 0

I am having a string as follows

NSString str1 = @"Hello your bal = 68094";

and I want to remove all characters after “=” symbol encounters in string.

Can any one give me the solution for this?

  • 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-31T06:45:22+00:00Added an answer on May 31, 2026 at 6:45 am

    Try the following solution:

    NSString *str1 = @"Hello your bal = 68094";
    NSRange range = [str1 rangeOfString:@"="];
    if (range.location != NSNotFound) {
        NSString *newString = [str1 substringToIndex:range.location];
        NSLog(@"%@",newString);
    } else {
        NSLog(@"= is not found");
    }
    

    or

    NSString *str1 = @"Hello your bal = 68094";
    NSRange range = [str1 rangeOfString:@"="];
    if (range.location != NSNotFound) {
        NSString *newString = [str1 substringWithRange:NSMakeRange(0, range.location)];
        NSLog(@"%@",newString);
    } else {
        NSLog(@"= is not found");
    }
    

    Update for @geekay_gk:
    If you are sure that you would have 2 “=” in your string, then

    NSString *str1=@"Hello your balance = 60094 and your id = rt456";
    NSRange range = [str1 rangeOfString:@"=" options: NSBackwardsSearch];
    NSString *newString = [str1 substringFromIndex:(range.location+1)];
    NSLog(@"%@",newString);
    

    If it contains whitespace, it would be better to trim the string.

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

Sidebar

Related Questions

Hi all i am having a string as follows string abc= 1) ABC <br>
I'm often having code written as follows try: self.title = item.title().content.string except AttributeError, e:
Im having a problem with removing non-utf8 characters from string, which are not displaying
Suppose I am having two Strings as follows : String name = EXAMPLE_MODEL_1; String
I am having a class as follows public class UserRoleModel { public string Role
I'm having a set of row data as follows List<String> l_lstRowData = new List<string>
All, I am using the Parallels.ForEach as follows private void fillEventDifferencesParallels(IProducerConsumerCollection<IEvent> events, Dictionary<string, IEvent>
I am having two list<string> as follows listA is having the following values 10,20,30,40
I am having an string like this string str = dfdsfdsf8fdfdfd9dfdfd4 I need to
Having read the documentation of Java's String class, it doesn't appear to support popping

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.