| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 925 人关注过本帖
标题: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
快速回复:split能不能取出二维数组
数据加载中...
 
   



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

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