Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class BinToASCII {
- public static void main(String[] args) {
- String in = "0101010001100001011010110110111101110110011001010010000001110100011011110010000001101100011010010110111001100101001000000111001101101111011000100110111101110100011011100110100100100000011011110110010001110000011011110110110001100101011001000110111001100101001000000011101000101001";
- // http://stackoverflow.com/a/2297450/1974494
- String[] data = in.split("(?<=\\G........)");
- for (int i = 0; i < data.length; i++) {
- char pismeno = (char) Integer.parseInt(data[i], 2);
- System.out.print(pismeno);
- }
- System.out.println();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment