Little bit of Java in VB?

S

Soulblade

Hi

Those of you that know Java (not the liquid), please help me out.

Remeber in Java one can build up a string seperated by a character o
your choice (eg; #, *, &, etc.) You then use stringTokenizer t
identify this character and to seperate the words.

Is there a way to do this in VB?

Thanx in advanc
 
C

Chip Pearson

I'm not familiar with Java, but you might want to use the Split
function. E.g.,


Dim S As String
Dim Arr As Variant
Dim N As Integer
S = "abc|def|ghi"
Arr = Split(S, "|")
For N = LBound(Arr) To UBound(Arr)
Debug.Print Arr(N)
Next N


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Top