I have a 32-bit long string of 0s and 1s. I just want this string to be flipped just like binary bits. That is, 0s are to be replaced with 1s and 1s with 0s. I tried doing this replacement with this code in Java:
String flippedBit = StringUtils.replaceEach(PadChar,
new String[]{"0","1"}, new String[]{"1","0"}, false);
But I get this error:
The method replaceEach(String, String[], String[]) in the type StringUtils is not applicable for the arguments (String, String[], String[], boolean)
Again, I have to store this string in an Integer by first converting it into 32-bit binary.