count_pieces | R Documentation |
Counts number of pieces of a string separated by a pattern. If it's an empty string, returns 0. If the pattern isn't found, returns 1. If the pattern is found once, returns 2 (two pieces), etc.
count_pieces(x, sep)
x |
Input string. |
sep |
Pattern to count for. |
Number of parts.
(a <- gpgr:::count_pieces("foo,bar,baz", sep = ","))
(b <- gpgr:::count_pieces("foo", sep = ","))
(k <- gpgr:::count_pieces("", sep = ","))
(m <- gpgr:::count_pieces(",", sep = ","))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.