C#用split分隔字符串后,怎么将分隔的字符遍历显示到不同的TextBox里
C#用split分隔字符串后,怎么将分隔的字符遍历显示到不同的TextBox里stringtime="2009-4-13+2009-5-1";string[]str=ti...
C#用split分隔字符串后,怎么将分隔的字符遍历显示到不同的TextBox里
string time = "2009-4-13+2009-5-1";
string[] str = time.Split(new char[] { '+' });
string[] ss = new string[2];
foreach(string s in str)
{
ss[i] = s.ToString();
}
this.txt_statetime.Text = ss[0];
this.txt_endtime.Text = ss[1];
把分隔后的字符串分别显示到txt_statetime,txt_endtime里 展开
string time = "2009-4-13+2009-5-1";
string[] str = time.Split(new char[] { '+' });
string[] ss = new string[2];
foreach(string s in str)
{
ss[i] = s.ToString();
}
this.txt_statetime.Text = ss[0];
this.txt_endtime.Text = ss[1];
把分隔后的字符串分别显示到txt_statetime,txt_endtime里 展开
展开全部
string time = "2009-4-13+2009-5-1";
string[] str = time.Split('+');
string[] ss = new string[str.Length];
int i = 0;
foreach (string s in str)
{
ss[i] = s.ToString();
i++;
}
this.txt_statetime.Text = ss[0];
this.txt_endtime.Text = ss[1];
string[] str = time.Split('+');
string[] ss = new string[str.Length];
int i = 0;
foreach (string s in str)
{
ss[i] = s.ToString();
i++;
}
this.txt_statetime.Text = ss[0];
this.txt_endtime.Text = ss[1];
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询