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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:42:23+00:00 2026-05-28T19:42:23+00:00

i was working on a personal program, and in it, i get some strings

  • 0

i was working on a personal program, and in it, i get some strings which may have a space hyphen space. or something like this: ” – “ and what I have to do is replace this with a single space. Now, the problem is, when i try to use a replace method from the c# library it doesn’t seem to do anything.
This is what i tried:

string firsttext = firsttextbox.Text.ToLower();
string name = firsttext.Replace(" - ", " ");

But this fails to replace the string in firsttext’s space hyphen space pattern with a single space. So when i try to use this text for example:

Code Geass - Lelouch of the Rebellion

it just returns this into string name:

Code Geass - Lelouch of the Rebellion

however it should actually be returning this:

Code Geass Lelouch of the Rebellion

Whats wrong with my idea? Or can I do it differently? Thanks for the help in advance.

Full code for those requested:
http://pastebin.com/hwUtFe8N

  • 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-28T19:42:23+00:00Added an answer on May 28, 2026 at 7:42 pm

    In your code, I only see .Replace(" ", "-");
    (eg. Replace space with dash)

    I don’t see what you describe, which is replacing a space-dash-space with just a space.

    In otherwords, your code doesn’t match your question.

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

Sidebar

Related Questions

I am working on a personal webpage, a draft version of which I have
Been working on a personal add-in for VS 2008 and have been researching automation
I'm working on a machine which has some code running on it which sets
I'm working on a personal helper library for my projects. I have a lot
I am working on a personal project involving some jQuery / native Javascript programming.
I'm working on a personal project (Search engine) and have a bit of a
Ive been working on my personal page which is based on drupal. Ive noticed
I am working on this personal project and the sign-in screen of the website
I have a personal project I'm working on that requires Microsoft SAPI5 -- text
I am working on a personal project in winforms just to gain some experience

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.