splitByPattern
From R.utils v1.4.2
by Henrik Bengtsson
Splits a single character string by pattern
Splits a single character string by pattern. The main difference compared to strsplit
()
is that this method also returns the part of the string that matched
the pattern. Also, it only takes a single character string.
- Keywords
- programming
Usage
## S3 method for class 'default':
splitByPattern(str, pattern, ...)
Arguments
Value
See Also
Compare to strsplit
().
Examples
rspCode <- "<body>Hello <%="world"%></body>"
rspParts <- splitByPattern(rspCode, pattern="<%.*%>")
cat(rspCode, "")
print(rspParts)
Community examples
Looks like there are no examples yet.