novaleaf
how to avoid "-0" when converting float to string?
when I convert floats to string like in this example, often I get "-0" as a value. Does anyone know a simple way to convert these to positive zero?
this is for serialization purposes, so I'd like to avoid some heavy checks just to avoid -0
6 replies
❔ Tersest way to get (up to) last 3 elements in an array? (source array may have less than 3 items!)
Hello, trying to do something "simple", splitting a path string by
\
and getting the last 3 folders:
The problem is this doesn't work if the Split()
returns an array less than 3 long. I get an out of range exception)
Is there some very terse work around that will get me the last 3 elements (or up to 3) of an array?5 replies