Pages

Monday, March 11, 2013

ASP.Net and C Sharp String Manipulation


1.using foreach loop for split the comma in that string

 foreach (string c in Controls.Text.Split(','))
                    {
                        if (c == Target.ID)
                        {
}
}


2.Get the specific values in that string using substring method


3.Replace the string
toAddress = toAddress.Replace(";", ",");


4.Get the string after comma
string[] words = subject.Split(',');
                string title = words[0];
                string Roomtoretrieve = words[1];
                string MeetingRoom = words[2];

No comments:

Post a Comment