Binary string replace