How to Split and Add String in C#

Jayakumars
Posted by Jayakumars under ASP.NET AJAX category on | Points: 40 | Views : 925
How to Split and Add String in C#
============================================================
string st1 = "12345 5879 96547 85474 965874 664254";
string st2 = "";
for (int i = 0; i <= st1.Split(' ').Length-1; i++)
{
st2 +=" '" + st1.Split(' ')[i] + "',";
}
Response.Write(st2.ToString().Substring(1,st2.Length-2));

Comments or Responses

Login to post response