In trying to track down a Python problem, I found that Panorama was passing a null character (\x00) in the text. It’s not Panorama’s fault that it’s there, but I can’t find a way to get rid of it. strip( doesn’t seem to do it.
replace(TextVariable,chr(0),"")
I think @pcnewble has the best idea for this. You could also use the characterfilter( function, but if you just want to strip out nulls and nothing else, I think replace( is simpler.
A couple of notes about the strip( function. First of all, it only strips out whitespace characters, which specifically is spaces, tabs, carriage returns and linefeeds. That’s it. Null characters are not considered whitespace.
More importantly, the strip( function ONLY removes whitespace characters at the beginning and the end of the text, not in the middle. I’m guessing you probably want to remove null characters anywhere in the text, not just at the beginning or the end. The replace( function will do that.
On the other hand, if Python is passing you a C string with a null on the end, then you may not need to remove nulls in the middle. Nevertheless, the strip( function won’t work because it doesn’t consider null to be a whitespace character.
Or to replace null(s) at the beginning and/or end only:
regexreplace(TextVariable,"^\x00*","","\x00*$","")
Witchcraft!