stripIfNotNone

lsst.daf.butler.core.utils.stripIfNotNone(s)

Strip leading and trailing whitespace if the given object is not None.

Parameters:
s : str, optional

Input string.

Returns:
r : str or None

A string with leading and trailing whitespace stripped if s is not None, or None if s is None.