Research_Agent / phidata /phi /utils /format_str.py
zykrix
Re-added phidata as a normal folder (final fix)
c96b98a
Raw
History Blame Contribute Delete
376 Bytes
from typing import Optional
def remove_indent(s: Optional[str]) -> Optional[str]:
"""
Remove the indent from a string.
Args:
s (str): String to remove indent from
Returns:
str: String with indent removed
"""
if s is not None and isinstance(s, str):
return "\n".join([line.strip() for line in s.split("\n")])
return None