字符分隔问题!帮忙解决的啊!
zwm00 2006-12-23 09:45:55 有如下格式的数据:
12 45 56 56 55
58 87 45 56 45
从文本文档读入后:
要得到一个2行5列的数组
结果得到了空字符串,在有回车的地方(每行结尾,怎么去掉的啊)
各位帮帮忙啊!不胜感激!
代码如下:
public c(,) as integer
Dim Str As IO.StreamReader = New IO.StreamReader(IO.File.OpenRead(file_name), System.Text.Encoding.GetEncoding("gb2312"))
Dim rs As String = Str.ReadToEnd
dim cc() as string=rs.split(VbCrLf)
dim i as integer=0
dim j as integer =0
dim a as integer
dim b as integer =UBound(cc)
for i=0 to b
dim d() as string=cc(i).split(nothing)
a=UBound(d)
redim c(b,a)
for j=0 to a
response.write(d(j))
next
next
response.write("数据写出结束")
Str.Close()