stripIfNotNone

lsst.daf.butler.utils.stripIfNotNone(s: str | None) str | None

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

Parameters:
sstr, optional

Input string.

Returns:
rstr or None

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