ElementAtOrDefault()
string[] list_of_strings ={"ala", "ma","mala" } set default="something" string q =list_of_strings.ElementAtOrDefault(0) string x =list_of_strings.ElementAtOrDefault(1) string y =list_of_strings.ElementAtOrDefault(2) string z =list_of_strings.ElementAtOrDefault(3) Console.Write(q + Environment.NewLine); Console.Write(x + Environment.NewLine); Console.Write(y + Environment.NewLine); Console.Write(z + Environment.NewLine);
Item[]
string abc = List_of_strings[4].name ?? "something";
List_of_strings
List_of_strings[4]
null
cmd.Parameters.Add("@state", SqlDbType.NVarChar).Value = member?.state ?? "none";
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)