S
S
subdan2014-10-10 20:48:25
Objective-C
subdan, 2014-10-10 20:48:25

How to use Swift to convert a string containing a binary number to a hexadecimal number?

How to translate a very long string like:
var str = "101010111111010101011"
into a hexadecimal number as a string "157EAB" ?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
evnuh, 2014-10-10
@subdan

Split by 4 bits, translate by binary arithmetic. Easy to google, for example here stackoverflow.com/questions/19461478/convert-binar... .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question