Why not just `s.strip()`?