Hello All,
I am doing the following:
public String stringToBinary(String input) {
int intRepresentation = Integer.parseInt(input, 16);
String binaryString = Integer.toBinaryString(intRepresentation);
return(binaryString);
}
I need the leading zeros though for my project, they are crucial. For example for the input:
'03' I need the function to return '00000011' not '11' like it does currently.
Another example, if input was '36' then I need it to return '0011 0110'.
Thanks guys!