First, a method declaration should be:
public static string ToCsv<T>(this List<T> list) {
Note that the method must be parameterized; it is <T>after the method name.
Secondly, do not reinvent the wheel. Just use String.Join:
public static string ToCsv<T>(this IEnumerable<T> source, string separator) {
return String.Join(separator, source.Select(x => x.ToString()).ToArray());
}
public static string ToCsv<T>(this IEnumerable<T> source) {
return source.ToCsv(", ");
}
Note that I went on a date and generalized the method further by accepting IEnumerable<T>instead List<T>.
.NET 4.0 :
public static string ToCsv<T>(this IEnumerable<T> source, string separator) {
return String.Join(separator, source.Select(x => x.ToString());
}
public static string ToCsv<T>(this IEnumerable<T> source) {
return source.ToCsv(", ");
}
source.Select(x => x.ToString()) .
, . " " .