3
$\begingroup$

I can get a binary representation of characters as follows:

BaseForm[ToCharacterCode["A"], 2]

enter image description here

However, that produces a weird binary code object that might be nice to look at, but not very practical to work with. What I would like to extract from this is a list of digits:

{1,0,0,0,0,0,1}

Is there a quick way to do that?

$\endgroup$

1 Answer 1

5
$\begingroup$

Try

IntegerDigits[ToCharacterCode["A"], 2]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.