Click here to Skip to main content
12,302,307 members (24,580 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# ASP.NET
hi iam using asp.net with c#.net


Label6.Text = listofboxes[1].boxName;
           Label6.Text += Environment.NewLine + listofboxes[1].packode;
           Label6.Text += Environment.NewLine + listofboxes[1].Status;

iam having string from which i have to select the characters after comma as shown below
iam getting this values from the above code.
E12 EE731330947CN, Avizo
D9 EE688798805CN, Expired


and based on this i to have display background colours for the labels
can you give examples which helps me.
Posted 30-Nov-12 22:46pm
Comments
Krunal R 1-Dec-12 4:48am
   
Do you want to select text after comma, am I correct ?

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

I assume that what you want to do is break the string into it's component parts:
E12 EE731330947CN, Avizo
Becomes
Box.boxName E12
Box.packode EE731330947CN
Box.Status  Avizo
If so, then it's pretty easy:
string inp = "E12 EE731330947CN, Avizo";
string[] parts = inp.Split(new char[] { ' ', ',' }, StringSplitOptions.RemoveEmptyEntries);
if (parts.Length == 3)
    {
    string Box = parts[0];
    string PackCode = parts[1];
    string Status = parts[2];
    }
  Permalink  
Comments
developerit 2-Dec-12 3:32am
   
thanks , problem is solved.......
OriginalGriff 2-Dec-12 3:49am
   
You're welcome!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web01 | 2.8.160530.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100