标题:split能不能取出二维数组
只看楼主
kenride
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-8-17
 问题点数:0 回复次数:1 
split能不能取出二维数组
rt:
具体怎么实现,谢谢
搜索更多相关主题的帖子: split 
2005-08-17 12:07
8888
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2005-8-18
得分:0 

Dim str As String Dim Our() As String

Private Sub Command1_Click() Dim n1 As Long, n2 As Long s1 = Split(str) '确定二维数组的维数 For Each s2 In s1 n1 = n1 + 1 If n1 = 1 Then s3 = Split(s2, "|") For Each s4 In s3 n2 = n2 + 1 Next End If Next ReDim Our(1 To n1, 1 To n2) n1 = 0 s1 = Split(str) '给二维数组赋值 For Each s2 In s1 n1 = n1 + 1 s3 = Split(s2, "|") n2 = 0 For Each s4 In s3 n2 = n2 + 1 Our(n1, n2) = s4 Next Next '查看二维数组的内容 For i = 1 To n1 For j = 1 To n2 MsgBox "our(" & i & "," & j & ")=" & Our(i, j) Next Next End Sub

Private Sub Form_Load() str = "张三|男 李诗|女 王六|男" End Sub

2005-08-18 23:58



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-25385-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.711593 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved