static bool isOnlySpaces(S s) {
  for (char c : characters(s))
    if (!isSpace(c)) false;
  true;
}