VBA中用split函数分割含有不定空格的STRING,该如何处理?
LineInput#1,onelinestringDimelementstringAsVariantelementstring=Split(onelinestring,"...
Line Input #1, onelinestring
Dim elementstring As Variant
elementstring = Split(onelinestring, " ")
Dim param(0 To 8) As String
For i = LBound(elementstring) To UBound(elementstring)
If (Len(elementstring(i)) <> 0) Then
param(j) = elementstring(i)
j = j + 1
End If
Next i
在处理txt文本:W -40.0 -100.0 500.0 450.0 0 0时候,提示j的下标超出范围,该肿么办? 展开
Dim elementstring As Variant
elementstring = Split(onelinestring, " ")
Dim param(0 To 8) As String
For i = LBound(elementstring) To UBound(elementstring)
If (Len(elementstring(i)) <> 0) Then
param(j) = elementstring(i)
j = j + 1
End If
Next i
在处理txt文本:W -40.0 -100.0 500.0 450.0 0 0时候,提示j的下标超出范围,该肿么办? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询