I have String containing zeros, ones and unfortunately a lot of white spaces. I want to write method which will get rid of all the white spaces and return String with just ones and zeros.
How can I do that?
String example= new String("1 011 01 1");
String shouldReturnStringWithoutWhiteSpaces(String given){
String cleanString
//some action which will "transform "1 011 01 1" into "1011011"
return cleanString;
}