ToArray
In this chapter you will learn:
Get to know ToArray operator
using System;/*from j a v a 2s . c o m*/
using System.Linq;
using System.Collections;
using System.Collections.Generic;
public class MainClass {
public static void Main() {
string[] presidents = {"G", "java2s.com", "a", "H", "over", "Jack"};
string[] names = presidents.OfType<string>().ToArray();
foreach (string name in names)
Console.WriteLine(name);
}
}
Next chapter...
What you will learn in the next chapter:
Home » C# Tutorial » Linq Operators