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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T11:42:47+00:00 2026-05-29T11:42:47+00:00

Sorry as the question is bit lengthy. I have this string Hello how are

  • 0

Sorry as the question is bit lengthy.

I have this string "Hello how are you"

When I pass it to this function in ASP.Net C#

private void separateSpaces(string text)
{
 string[] separatedWords = text.Split(' ');
 for(int i=0;i<separatedWords.length;i++)
 {
   Response.Write("<br>"+separatedWords[$i]);
 }
}

When I run that string to this function , I get my expected answer perfectly. Like

Hello
how
are
you

But when I subject this text. I am getting a wrong output

This is the text

Fusion Technologies, Hyderabad, India                           May 2005 – July 2007
Net Developer

Everything breaks fine , except for

India May

it is treated as a string together. I need both of them to be separate

  • 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-29T11:42:49+00:00Added an answer on May 29, 2026 at 11:42 am

    Maybe India May is treated as single string because there’s no space between them (and for example other whitespace, like \t)?

    Try this and see whether it works:

    string[] seperatedWords = text.Split(default(string[]), 
        StringSplitOptions.RemoveEmptyEntries);
    

    The default(string[]) is simply null. When String.Split receives null as first argument, it treats all whitespace characters (matched by Char.IsWhiteSpace) as delimeters.

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

Sidebar

Related Questions

Sorry, a beginner's question: I have a very simple function in my Django application
Sorry if the question is bit confusing. This is similar to this question I
Sorry that the question of this problem might be a bit vague. I'm trying
Sorry if this is a bit of a noob question but I am still
Sorry if this is a bit of a starter question but I am pretty
I've kind of asked this question earlier so sorry for asking a bit similar
sorry if this question seems a bit open ended, but I'm often wanting to
I'm sorry this question is going to be a bit vague because I'm not
sorry ma question went wrong a bit the alis has value like alias =Sri
Sorry if this question seems trivial to many here. In a C++ code there

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.