I have a field from a datagrid that contains employee id separated by a comma for example
2,3,22
or
22,3
or
2,3
or
2,44,104
any combination of single double or triple digits separated with a comma
What I need to do is separte each of those ids one at a time and run it through a process
code would look something like this for the string "2,44,104'
Dim intI as integer
dim intID as integer
Dim IntNumber as integer = string function to get number of commas + 1 (this would get the number of IDs as 3)
do while intI less or equal to IntNumber
intID = String function to get IntI number
do stuff with intID
intI +1
next
the first pass throught the loop IntID = 2
second pass through the loop IntID = 44
third pass through the loop IntID = 104
the number of ID is that original string vary and each ID may be 1 2 or 3 characters in length.
Thanks for you help
2,3,22
or
22,3
or
2,3
or
2,44,104
any combination of single double or triple digits separated with a comma
What I need to do is separte each of those ids one at a time and run it through a process
code would look something like this for the string "2,44,104'
Dim intI as integer
dim intID as integer
Dim IntNumber as integer = string function to get number of commas + 1 (this would get the number of IDs as 3)
do while intI less or equal to IntNumber
intID = String function to get IntI number
do stuff with intID
intI +1
next
the first pass throught the loop IntID = 2
second pass through the loop IntID = 44
third pass through the loop IntID = 104
the number of ID is that original string vary and each ID may be 1 2 or 3 characters in length.
Thanks for you help