check if there are two spaces between words java code example Example: java remove double spaces StringUtils.normalizeSpace(string);