Tuesday, 10 September 2013

C# array null/empty string values

String[] URL= {"1","2","","4","6",""};

var temp = new List<string>();
foreach (var s in URL)
{
         if (!string.IsNullOrEmpty(s))
         {
              temp.Add(s);
}
URL = temp.ToArray();

No comments:

Post a Comment