---js
-----------c#
protected void Button1_Click(object sender, EventArgs e)
{
var str = Button1.Text;
Button1.Text = "";
var length = str.Length;
var strNew = "";
if (!str.Contains(','))
{
for (int i = 1; i <= length; i++)
{
var first = str.Substring(0, 1);
strNew += first + ",";
str = str.Substring(1);
}
Button1.Text = strNew.Substring(0, strNew.Length - 1);
}
else
{
for (int i = 0; i < str.Split(',').Length; i++)
{
strNew += str.Split(',')[i];
}
Button1.Text = strNew;
}
}
class Program
{
static void Main(string[] args)
{
string num = "123456789";
char[] one = num.ToCharArray();
for (int i = 0; i < one.Length;i++ )
{
System.Console.WriteLine(one[i]);
}
}
}
Char[] char = "123456789".Split('');
Regex re = new Regex (@"\B");
string[] substrings = re.Split("123456789");