-
December 19th, 2012, 06:24 AM
#1
Visual studio 2008 - Loop in Array
Hi to all!!!!
I have a parameter field which is of the form "20-100-105"
I use the commands
Dim DimArr() As String
DimArr = Dim_Len.Split("-")
I want to create a loop to find out how many fields in my array is not empty.
"20-100" = 2
"20-100-105" = 3
"20-100-105-160" = 4
Can anyone help me!!!!!!
Thanks and regards.
-
December 19th, 2012, 06:45 AM
#2
Re: Visual studio 2008 - Loop in Array
Finally is too silly question.....
Dim i As Integer = DimArr.Length
-
December 19th, 2012, 07:10 PM
#3
Re: Visual studio 2008 - Loop in Array
Hey,
You should use something along the lines of:
Code:
dim number_of_not_empty_fields as integer = 0
Dim DimArr() As String
DimArr = Dim_Len.Split("-")
For each Fieldcount in Dimarr
if Dimarr(Fieldcount).length > 0 then
number_of_not_empty_fields += 1
end if
Next
I haven't tested it but should be close
-Robbo
Hope it helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|