Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

Please send me the Code for checking whether string array is empty or not using c#.

Thanks
Posted
Updated 9-Sep-11 2:29am
v2
Comments
BobJanova 9-Sep-11 8:41am    
This is one of those 'if you don't know this, time to go back to basics' questions ...

use length property of string array

if array is empty then length is zero.
 
Share this answer
 
v2
Comments
BobJanova 9-Sep-11 8:41am    
Simple and correct (assuming the OP doesn't have some weird definition of empty)
Oludayo Alli 9-Sep-11 9:31am    
simple!
 
Share this answer
 
Hi,Try this
C#
for(int i=0;i< arr.length;15;i++){
if(arr[i]==null)
//Do the task

}
 
Share this answer
 
Comments
Rhys Gravell 9-Sep-11 8:46am    
This is so wrong it's appalling

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