java regex replace multiple spaces with single space code example Example: java remove double spaces StringUtils.normalizeSpace(string);