use delimeters with multiple spaces java code example Example: java remove double spaces StringUtils.normalizeSpace(string);