fetch value from comma seperated string
I have a variable myvar char(100).
I have assign a value to it myvar='abc,bb,xft,gty'
First I want to check how many , are there in this variable.
second I want to get the value from this variable before each comma like:
I am working on db2 databse.
Fetch Values from Comma Deliminated String
Here is how I do it.
Dim aInfo As Array
'set aInfo to variable returned from db2 then...
aInfo = strData.Split(",")
If aInfo.Length < 0 Then
Throw New Exception("Missing data ")
If IsNothing(aInfo(0).ToString.Trim) Then
gECnbr = " "
gECnbr = aInfo(0).ToString
Me.txtReason.Text = "EC" & gECnbr.TrimEnd
If IsNothing(aInfo(1).ToString.Trim) Then
gECrev = " "
gECrev = aInfo(1).ToString