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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:30:26+00:00 2026-05-31T13:30:26+00:00

I am having an issue where I try to create a string but one

  • 0

I am having an issue where I try to create a string but one of the letters in that string (m) is being dropped. I don’t understand what is going on, how do you fix it?

This is the code:

typeTo.text = [typeTo.text stringByReplacingOccurrencesOfString:@"random" withString:@"(random (1,10000000)/10000000)"];
NSLog(@"%@", typeTo.text);

NSLog prints:

rando

Thanks

  • 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-31T13:30:27+00:00Added an answer on May 31, 2026 at 1:30 pm

    Please check the input string… I just tested this:

    NSString *initialString = @"a random string is always random";
    initialString = [initialString stringByReplacingOccurrencesOfString:@"random" withString:@"(random (1,10000000)/10000000)"];
    NSLog(@"%@", initialString);
    

    And it printed:

    2012-03-17 21:15:41.276 Untitled[39581:903] a (random
    (1,10000000)/10000000) string is always (random (1,10000000)/10000000)

    It’s working fine, replacing all occurrences of random with (random (1,10000000)/10000000).

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

Sidebar

Related Questions

I'm having an issue with MySQL and PHP. When I try to create a
I'm having an issue with a field being validated that seemingly is failing validation,
I am having an issue where I try to access the Lists.asmx web service
Im having an issue over loading the constructors in Scala. Each time I try
I am running NServiceBus and having this issue . To try and troubleshoot it
I am having this most annoying issue when I try to rebuild my solution
I having issue that content assistant / intellisense is working in methods such as
Having a issue where all mobile devices is zoomed 50% in at start. That
EDIT: After fixing a few issues, the bigger issue that I am having is
I'm having trouble with one particular issue, I was hoping someone could help me

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.