Answers for "c# how to return a list"

C#
1

c# return list

Try this:

public static List<string> retrieveAllIP() 
{
   var retList = new List<string>();
   foreach(strings inaddIP)
   {
      string returnIP = s;
      retList.Add(returnIP);
   }
   return retList;
}
Posted by: Guest on March-05-2021
0

c# return list

static void Main(string[] args)  
{  
    List<string> range = WildcardFiles();
    foreach (string item in range)
    {
        // Do something with item
    }
}  

static List<string> WildcardFiles()
{  
    List<string> listRange = new List<string>();  
    listRange.Add("q");  
    listRange.Add("s");  

    return listRange;  
}
Posted by: Guest on March-26-2022

Code answers related to "c# how to return a list"

C# Answers by Framework

Browse Popular Code Answers by Language