kengkit
asked on
error come out when i using InStr
Dim test As String = "BB1234/34"
Dim newstring As String = Left(test, InStr(test, "/") -1)
the following error message come out when the above code is used... why?
Compiler Error Message: BC30471: Expression is not an array or a method, and cannot have an argument list.
Dim newstring As String = Left(test, InStr(test, "/") -1)
the following error message come out when the above code is used... why?
Compiler Error Message: BC30471: Expression is not an array or a method, and cannot have an argument list.
Hi kengkit,
You should use the .Net methods:
Dim test As String = "BB1234/34"
Dim newstring As String = test.Substring(0, test.IndexOf("/"))
Cheers!
You should use the .Net methods:
Dim test As String = "BB1234/34"
Dim newstring As String = test.Substring(0, test.IndexOf("/"))
Cheers!
ASKER
Hi emoreau
if i using ur method.. the result return is 'BB1234' but not '34'
wat to do if i gonna get '34' ??
if i using ur method.. the result return is 'BB1234' but not '34'
wat to do if i gonna get '34' ??
Then try this
Dim test As String = "BB1234/34"
Dim newstring As String = test.Substring(test.IndexO f("/") + 1)
Dim test As String = "BB1234/34"
Dim newstring As String = test.Substring(test.IndexO
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
honjun.. u got the point!! becoz wat i request for is not "BB1234"
Got the points but with a C grade?
Please explain.
Please explain.
Try:
Dim test As String = "BB1234/34"
Dim newString As String = test.Substring(0, InStr(test, "/") - 1)