0

I'm trying to split a string containing "."

For example : "Who.am.I?"

"Who", "am", "I?"

In a similar attempt, it succeeded in splitting characters by "&" by using stringr::str_split() For example:

stringr::str_split("Who&am&I?", pattern="&")
[[1]]
[1] "Who" "am" "I?"

It can be divided like this.

However, changing & to. yields the following results

stringr::str_split("Who.am.I?", pattern=".")
[[1]]
[1] "" "" "" "" "" "" "" "" "" ""
  1. Why return this kind of output?
  2. Is there a way to use "." as a pattern? Could you tell us about the above two points?

I really appreciate any help you can provide.

Tokunaga

0 Answers0