|
不好意识,刚才没有仔细看。你的拆分符应该是*和/,不知道你双/是一个还是两个字符。n你的字符串是不是很有规律?都是A*B//C*D,大致是一下,你测试一下:
dim strItem(3) as string
function OutChar(strWord as string)
dim strTmp as string,intStart as integer,intLen as integer
dim intId as integer,intLenOfWord as integer
dim intN as integer
for intN=1 to 3
strItem(intN)=""
next
intStart=1;intLen=0;intId=1
intLenOfWord=Len(strWord)
for intN=1 to intLenOfWord
strTmp=mid(strword,intN,1)
if strTmp="*" or strTmp="/" then
strItem(intId)=mid(strWord,intStart,intLen)
intStart=intN+1
intLen=0
intId=intId+1
else
intLen=intLen+1
end if
if intN=intLenOfWord then
strItem(3)=mid(strWord,intStart,intLen)
end if
next
end function |
|