def str_strip(arr, to_strip=None, side='<STR_LIT>'):
if side == '<STR_LIT>':<EOL><INDENT>f = lambda x: x.strip(to_strip)<EOL><DEDENT>elif side == '<STR_LIT:left>':<EOL><INDENT>f = lambda x: x.lstrip(to_strip)<EOL><DEDENT>elif side == '<STR_LIT:right>':<EOL><INDENT>f = lambda x: x.rstrip(to_strip)<EOL><DEDENT>else:  <EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>return _na_map(f, arr)<EOL>
Strip whitespace (including newlines) from each string in the
Series/Index.

Parameters
----------
to_strip : str or unicode
side : {'left', 'right', 'both'}, default 'both'

Returns
-------
Series or Index