Q:

How to convert or typecast to binaryInteger from string?

"11001001101000000100010101"

"00111000000011010000101011"

AND
= 00001000000000000000000001

Binary representation:
"11001001101000000100010101" = > 0b11001001101000000100010101

"00111000000011010000101011" = > 0b00111000000011010000101011

Two strings but value looks like binary and 
I want to Bitwise And Operator of two binary.
How to convert string to binary?

A:

Both UInt and String has init methods where you can give the radix (base ) of the number
let s1 = "11001001101000000100010101"
let s2 = "00111000000011010000101011"

if let binary1 = UInt(s1, radix: 2), let binary2 = UInt(s2, radix: 2) {
    let res = binary1 & binary2
    print(String(res, radix: 2))
}

output 

1000000000000000000001

