I have a string "Test||Test1||test2"
that I want to tokenize by ||
. However, what I got is always the individual characters (with 2 empty chars at both ends):
"" "T" "e" "s" "t" "1" "|" "|" "T" "e" "s" "t" "2" "|" "|" "T" "e" "s" "t" "3" ""
I have tried both: strsplit(myString, "||")
and str_split(myString, "||")
from the library tidyverse
(from this tutorial, seems like it should work) but got the same incorrect result.
How do I tokenize string based on double/multiple-character delimiter?