日期:2014-05-18  浏览次数:20904 次

怎么在richTextBox1中显示一个多行三列的的矩阵(数组)
name定义成一个Array name = new double[125,3];
我现在用this.richTextBox1.AppendText(name + "\n");然后在richTextBox1显示的不规律,有没有什么办法让他的按照原来的规律显示?比如现在我实现的是:
45232.1328070293,56242.1558070293,3.01280702925038,45232.1525672232,56242.1750672232,3.02256722324405,45232.1930031617,56242.1910031617,3.05800316173677,
想做成这样:
45232.1328070293,56242.1558070293,3.01280702925038,
45232.1525672232,56242.1750672232,3.02256722324405,
45232.1930031617,56242.1910031617,3.05800316173677,


------解决方案--------------------
C# code

string input=@"45232.1328070293,56242.1558070293,3.01280702925038,45232.1525672232,56242.1750672232,3.02256722324405,45232.1930031617,56242.1910031617,3.05800316173677,";
MatchCollection mc=Regex.Matches(input,@"(\d+\.\d+,){3}")

foreach(Match m in mc)
{
   this.richTextBox1.AppendText(m.Value+ "\r\n");
}