So, I have a
String, p, which I need to:
- trim off the beginning two character
- reverse it
- turn it into a char[]
In that order.
What I currently have is:
Which works, however it seems pretty unwieldy, so I'm wondering if there's a simpler (or more efficient) way to do it. Is what I have idiomatic
Java?
If what I'm trying to do is not clear, I'll give an example. If p was the string "0x50B", like a typical representation of a hex number, I want a char array containing {'B', '0', '5'}, which again, my code does give me, but I'm just wondering if there's a better way to do it.