stiring s_a = s.substring( s.lastindexof('\\行汪猜') + 1)
这个代码仅滑悔供参考,是截取一行的,你可以稍微改一下,加上读取文件手让李的内容。
private void SplitString(string str)
{
string[] arr1 = str.Split('.')
if (arr1.Length <2)
{
return
}
else if (arr1.Length == 2)
{
str = arr1[1]
}
else
{
str = "毕迟"
for (int i = 1i <arr1.Lengthi++)
{
str += (str.Length == 0 ? "" : ".") + arr1[i]
}
}
string temp1 = "", temp2 = ""
arr1 = str.Split(' ')
if (arr1.Length <2)
{
return
}
else if (arr1.Length == 2)
{
temp1 = arr1[0]
temp2 = arr1[1]
}
else
{
temp1 = arr1[0]
for (int i = 1i <arr1.Lengthi++)
{
temp2 += (temp2.Length == 0 ? "" : " ") + arr1[i]
}
}
listBox1.Items.Add(temp1)
listBox2.Items.Add(temp2)
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)