Value corresponding to the index.
If the node is a mapping, return the value corresponding to the first key equal to index. containsKey() can be used to determine if a mapping has a specific key.
To get element at a null index, use YAMLNull for index.
NodeException if the index could not be found, non-integral index is used with a sequence or the node is not a collection.
1 writeln("D:YAML Node opIndex unittest"); 2 alias Node.Value Value; 3 alias Node.Pair Pair; 4 5 Node narray = Node([11, 12, 13, 14]); 6 Node nmap = Node(["11", "12", "13", "14"], [11, 12, 13, 14]); 7 8 assert(narray[0].as!int == 11); 9 assert(null !is collectException(narray[42])); 10 assert(nmap["11"].as!int == 11); 11 assert(nmap["14"].as!int == 14);
Get the element at specified index.
If the node is a sequence, index must be integral.