final char space = ' ';
Method String::charAt() returns a char, not a String:
char
while (s.charAt(l) != space) {