Yes, thats one possibility. I would recommend you to use first the trim() method to remove spaces from the beginning and end. Then, you can use the startsWith() method to make sure your String begins with "0b" and finally the substring() method starting from index 1 to return the other part of the string. Another possibilities are the methods replace() or replaceAll(). Have a look at this website to know the descriptions of the String methods:
String (Java 2 Platform SE v1.4.2)