stringx::strsplit(c(x="a, b", y="c,d, e"), ",\\s*")
x <- strcat(c(
"abc", "123", ",!.", "\U0001F4A9",
"\U0001F64D\U0001F3FC\U0000200D\U00002642\U0000FE0F",
"\U000026F9\U0001F3FF\U0000200D\U00002640\U0000FE0F",
"\U0001F3F4\U000E0067\U000E0062\U000E0073\U000E0063\U000E0074\U000E007F"
))
# be careful when splitting into individual code points:
base::strsplit(x, "") # stringx does not support this
stringx::strsplit(x, "(?s)(?=.)", omit_empty=TRUE) # look-ahead for any char with dot-all
stringi::stri_split_boundaries(x, type="character") # grapheme clusters
Run the code above in your browser using DataLab