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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T06:50:53+00:00 2026-05-25T06:50:53+00:00

string value = L3 ABCD L4 3501% L5 20%,L3 EFGH L4 17260% L5 20%,L3

  • 0
string value = "L3 ABCD L4 3501% L5 20%,L3 EFGH L4 17260% L5 20%,L3 IJKL L4 2051% L5 20%,L3 MNOP L4 2621% L5 20%,L3 QRST L4 45325% L5 20% L2 40%";

I am trying

string[] splitvalues = value.Split();

then using a switch to find out whether it is L2, L3, L4, L5

But value at L5 is fetching “20%,L3”


The code is:

string[] splitvalues = value.Split();

for (int i = 0; i < splitvalues .Length; i = i + 2)
{
    String id = splitvalues [i];
    switch (id)
    {
        case "L3":
            Name = splitvalues [i + 1];
            break;
        case "L4":
            Number1.FromString(splitvalues [i + 1]);
            break;
        case "L5":
            Number2.FromString(splitvalues [i + 1]);
            break;
        case "L2":
            Number3.FromString(splitvalues [i + 1]);
            break;
    }
}
  • 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-25T06:50:53+00:00Added an answer on May 25, 2026 at 6:50 am

    Try this:

    string[] arr = value.Replace("," , " ").Split(' ');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

im trying to return a string value from a method inside my script tag
abcd+xyz i want to split the string and get left and right components with
Here is the string. $string = <option class=abcd value=1.5>Some Text with White Spaces</option> I
I have a string value that I want to write to the registry as
I have a string value coming from a label in the .aspx page as
I have string value and Type of some variable (For example int and 32
I've got a string value of the form 10123X123456 where 10 is the year,
How to read query string value via managed bean in jsf1.1
After saving a String value into memcached using the Danga client, I attempted to
I have a string value from a user input box. I have to figure

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.