Here is the comment I wrote, but the back ticks do not display as code. It works in this post. How to fix?
No, I got
=> ["this", "is", "the", "string", "to's", "split", "real", "", "ok", "", "nice-like"] which has one empty string.
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
You must not have blank space after the first backtick or before the last backtick.
In your comment to that answer you do have space before the last backtick:
Apparently the code filter in the comments is different and more "strict" than the filter in the posts but this explains this issue.
Whether by design or a bug, only developer can tell. :)
If you do want a space as the first or last character in between the backticks, there's a (quite ugly) workaround:
U+2060, which is the Unicode word joiner (WJ). It's zero width (hence invisible) and non-breaking. You can copy-paste it from here:
It's enclosed in between
». You may need to select/copy the whole line (all three characters) to catch it, and then remove the enclosing characters after pasting.
Warning: there is a chance that when someone copies the code (
...some code... ) including the invisible word joiner and pastes that into a code editor or a terminal, something won't work and, since the WJ is invisible, it's not obvious why it doesn't work. (I don't know if there's a solution to this..)