muttu
14 years agoOccasional Contributor
Unable to split the string using Chr(150)
Trying to spilt the string using Chr(150) which is ASCI representation of "-". But below error is displayed.
Sub SplitDemo2
SplitDemo2
Dim s, ss
s = "May 26 - June 25"
' Split at line break character.
ss = Split(s, Chr(150))
Log.Message("There are " & (UBound(ss)+1) & " words in the array")
Log.Message("The first word is: " & ss(0))
Log.Message("The first word is: " & ss(1))
End Sub
Result
An exception occurred in the "FS_OnlineLease" unit at line 854:
Microsoft VBScript runtime error
Subscript out of range: '[number: 1]'