以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]字符数组处理  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188325)

--  作者:kuroneko
--  发布时间:2023/9/14 11:11:00
--  [求助]字符数组处理

想得到这种效果。数组hths中元素按fphms中元素对应排序,hths中元素重复时,将对应fphms中的元素进行拼接
QAXSZ230811B/23088:666
QAXSZ230811A/23079:36357132_36357333
QAXSZ230328A/23039: 36356847_36356864

--  作者:有点蓝
--  发布时间:2023/9/14 11:29:00
--  
利用字典
dim dict as new dictionary(of string,string)
for i as integer = 0 to hths.length - 1
 if dict.containskey(hths(i)) then
dict(hths(i)) = dict(hths(i)) & "_" & fphms(i)
else
dict.add(hths(i), fphms(i))
end if
next

for each key as string in doct.keys
msgbox(key & ":" & dict(ke))
next