cbsbutler
asked on
Count length of string before unique character appears
I'm looking for some simple vb code that will count the length of text in a string before the ":" symbol appears.
Regards
Antonio
Regards
Antonio
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
VB6:
MsgBox (InStr("ThisTextIs16Long:A ndHereSome MoreText", ":")) - 1
VB.NET:
MsgBox("ThisTextIs16Long:A ndHereSome MoreText". IndexOf(": "))
MsgBox (InStr("ThisTextIs16Long:A
VB.NET:
MsgBox("ThisTextIs16Long:A
position = InStr("abc:def", ":") - 1
http://www.aivosto.com/vbtips/instr.html