// // Summary: // Creates a System.Collections.Generic.List<T> from an System.Collections.Generic.IEnumerable<T>. // // Parameters: // source: // The System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.List<T> // from. // // Type parameters: // TSource: // The type of the elements of source. // // Returns: // A System.Collections.Generic.List<T> that contains elements from the input // sequence. // // Exceptions: // System.ArgumentNullException: // source is null. public static List<TSource> ToList<TSource>(this IEnumerable<TSource> source);
foreach(string l in list)
{
//l 就是里面的项,可以进行操作
}
ICollection<T> Interface英文解释
中文解释
// Summary:
// Creates a System.Collections.Generic.List<T> from an System.Collections.Generic.IEnumerable<T>.
//
// Parameters:
// source:
// The System.Collections.Generic.IEnumerable<T> to create a System.Collections.Generic.List<T>
// from.
//
// Type parameters:
// TSource:
// The type of the elements of source.
//
// Returns:
// A System.Collections.Generic.List<T> that contains elements from the input
// sequence.
//
// Exceptions:
// System.ArgumentNullException:
// source is null.
public static List<TSource> ToList<TSource>(this IEnumerable<TSource> source);