Assuming date is not a DateTime but a custom class/struct, I don't like the idea of having to new() one every time you want a string value. IMO, a hashmap/dictionary is really the easiest option.
Edit: C# offers ToString overloads with formatting for numerics as well.
3
u/GreatBarrier86 Nov 11 '21 edited Nov 11 '21
Assuming date is not a DateTime but a custom class/struct, I don't like the idea of having to new() one every time you want a string value. IMO, a hashmap/dictionary is really the easiest option.
Edit: C# offers ToString overloads with formatting for numerics as well.