Description Usage Arguments Details Value Author(s) Examples
View source: R/str_split_ws_quoted.R
Splits a string on whitespace while ignoring whitespace inside quotes
1 | str_split_ws_quoted(x, quotes = c("'", "\""))
|
x |
character or string; (required) |
quotes |
character or string; character interpreted as quotes. The default is: ' single-quote and double-quote |
str_split_ws_quoted
splits strings into a vector elements delineated
by whitespace and ignoring whitespace enclosed in quotes. It also removes
those quotes from strings.
str_split_ws_quoted
uses not (yet?) allow for different opening and
closing characters.
character vector
Decision Patterns from the base.tools packages; used with permission.
1 2 3 4 5 6 7 | character(0) %>% str_split_ws_quoted() # character(0)
"" %>% str_split_ws_quoted() # "" - no splitting
"foo" %>% str_split_ws_quoted() # "foo"
"foo bar" %>% str_split_ws_quoted # "foo" "bar"
"'foo' bar" %>% str_split_ws_quoted # "foo" "bar"
"'foo' \"bar\"" %>% str_split_ws_quoted # "foo" "bar"
"'foo bar" %>% str_split_ws_quoted #
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.