string removeWhiteSpaces(string line) {
string s = "";
int space = 0;
while (true) {
if (line[space] == ' ')
space++;
else break;
}
for (int x = space; x < line.length(); x++)
s += line[x];
space = s.length() - 1;
while (true) {
if (s[space] == ' ') {
space--;
}
else
break;
}
for (int x = 0; x <= space; x++)
s[x] = s[x];
s[space + 1] = ' ';
return s;
}
input = " String "
ouput = "String"