@peterdrake comparing apples and oranges here… the analog to the java one would be
m[1]
What you picked is the try..get pattern used e.g. like this:
if (m.TryGetValue(1, out var val)) return val;
else return „fallback“, or, shorter
return m.TryGetValue(1, out var val) ? val : „fallback“;
@flq Yeah, I was just looking in the API for Dictionary and wondering why, if there was an Add method, there was no Get method. I had forgotten about square bracket access.
@damselfly @flq My server is running variant software that doesn't allow editing posts. I might delete it, but could someone else who overlooked the same thing benefit from the replies?
@peterdrake @flq Nobody reads the replies. 😉
Maybe get a better server?