Click here to Skip to main content
Rate this: bad
good
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 23:46pm
Comments
Krunal R at 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 at 2-Dec-12 3:32am
   
thanks , problem is solved.......
OriginalGriff at 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
0 OriginalGriff 280
1 Sebastiaan Meijerink 145
2 Sergey Alexandrovich Kryukov 108
3 Abhinav S 94
4 BillWoodruff 85
0 Sergey Alexandrovich Kryukov 6,558
1 OriginalGriff 6,288
2 Peter Leow 2,534
3 Abhinav S 2,358
4 Maciej Los 2,352


Advertise | Privacy | Mobile
Web01 | 2.8.150414.1 | Last Updated 1 Dec 2012
Copyright © CodeProject, 1999-2015
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