haxe icon indicating copy to clipboard operation
haxe copied to clipboard

Add StringTools.binary(..)

Open flashultra opened this issue 5 months ago • 3 comments

Since Haxe 5 it is possible to initialize a value like var i = 0b100000000000000001; (similar to hex var i = 0x10001;). Currently, StringTools.hex exists, but there is no similar function for binary representation. This pull request adds StringTools.binary(...)

flashultra avatar Jul 26 '25 15:07 flashultra

@Simn got anything against this?

kLabz avatar Nov 17 '25 15:11 kLabz

Isn't StringTools usually used as a static extension? That would make this a little weird... but I don't know where functions like this typically go.

Simn avatar Nov 17 '25 15:11 Simn

Well there's StringTools.hex there too, so I guess that's where functions like this went until now, at least :/

I agree that it's weird to see functions with Int first argument in a module meant for static extensions on String...

kLabz avatar Nov 18 '25 06:11 kLabz