Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hai I don't know how to check the list value
for example
VB
LocList = New List(Of List(Of String))

LocList is the list contains values

VB
LocList.Add("")
LocList.Add("one")
LocList.Add("")
LocList.Add("two")
LocList.Add("three")



how to check the loclist(0) and loclist(2) is empty or not
Posted

try..
VB
For Each str As String In LocList
        If (String.IsNullOrEmpty(str)) Then
            MessageBox.Show('empty')
        End If
    Next



Without ForEach loop..
try

VB
if LocList.Length>=1 then ' checking length of the list
      If (String.IsNullOrEmpty(list.Item(0))) Then
            MessageBox.Show('empty')
      End If

End If
 
Share this answer
 
v3
Comments
smksamy 30-Jan-15 5:13am    
hai, thanks for your response, do you have any idea without foreach, for example predefined list functions, check the list with index value that is empty or not,

if(listName.function(0)=="")then
/\jmot 30-Jan-15 5:20am    
Answer updated.See now.
Try this:
VB
If LocList.Item(0) = String.Empty Then
    'do something
End if
 
Share this answer
 
Comments
smksamy 30-Jan-15 5:34am    
superb man its working awesome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900