buffer function is no longer available for String ?
I see some old examples of String(“mojo”).buffer, but doesn’t look like it works now. Can anyone please help me point me on how to get the byte array that can handle Unicode bytes too
1 Reply
You can access underlying pointer using undocumented methods
_as_ptr()
or _steal_ptr()
. They work a bit strangely. I feel like due to lifetimes. So, you can play with them but I wouldn't count on them.
Let's see what new release of Mojo in 2024 will bring.