java check for double spaces in string code example Example: java remove double spaces StringUtils.normalizeSpace(string);