Click here to Skip to main content
15,899,025 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi iam using asp.net with c#.net


C#
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
Comments
[no name] 1-Dec-12 4:48am    
Do you want to select text after comma, am I correct ?

1 solution

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:
C#
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];
    }
 
Share this answer
 
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900