SyntaxFix
Write A Post
Hire A Developer
Questions
If you actually want your function to behave like the str() built-in, but return an empty string when the argument is None, do this:
str()
def xstr(s): if s is None: return '' return str(s)