I have been using NodeRed for quite a while and have never seen this before. I am using the "file" in node to grab the contents of a file and it seems to work fine, but it's outputting the message payload as a "string" in a way I have never seen before
I have a switch node after the file in and when doing a payload == some_value it does not work, if I use "contains" it works but that is not ideal in this situation, plus I would like to understand what this is. I have never seen a payload be marked as "string" this way. Any help would be greatly appreciated!
Alternatively you could leave it there and use a regex compare to look for something like ^yo\s$ (untested) which matches start of line followed by yo then one white space character and then end of line (I think, I always have to play about a bit to get regexs to work as I don't use them very often).
I always found regex101.com to be a good place to fiddle with regex expressions. I think the carriage return which is the problem here is \r in a regex if your trying to build one.
Happy forum anniversary by the way @Colin
Yes but trim() only removes it from the beginning and end of a string. And every blue moon It will miss a '/r' even if its at the end of a string. I've had trim() act funny with some of my returns from the exec node.
lets say I had a string from file like this:
As a variable msg.payload with no line break or return in the middle or the end.
This is why i posted the replace option