If I have a list of strings
List<String> list = new list<String>(); list.add("str1"); list.add("str2"); list.add("str3");
and I want to know if, for example, the position of index 2 contains an element, is there an easy way to do this without considering the length of the list or using try catch?
Since this fails, I can get around it with try catch, but it seems excessive
if(list.ElementAt(2) != null) {
list c #
JGilmartin Oct. 16 2018-10-16 13:43
source share