public class Example
{
public static void Main()
{
Console.Write("<< Enumerable.LastOrDefault 출력 예제 >> \n");
string[] codes = { "CodeA", "CodeB", "CodeC", "CodeD" };
string last = codes.LastOrDefault();
Console.WriteLine(String.IsNullOrEmpty(last) ? "<string is null or empty>" : last);
Console.WriteLine(System.Environment.NewLine);
Console.WriteLine("Press any key to exit");
Console.ReadKey();
}
}