Answers for "python binary to string"

0

python binary to string

>>> b'a string'.decode('utf-8')
'a string'
Posted by: Guest on October-19-2021
-2

binary to string

let binary = `1010011 1110100 1100001 1100011 1101011 
1001111 1110110 1100101 1110010 1100110 
1101100 1101111 1110111`;

let outputStr = binary.split(' ') //Split string in array of binary chars
   .map(bin => String.fromCharCode(parseInt(bin, 2))) //Map every binary char to real char
   .join(''); //Join the array back to a string

console.log(outputStr);
Posted by: Guest on April-20-2021

Code answers related to "python binary to string"

Python Answers by Framework

Browse Popular Code Answers by Language