
Last chance! 50% off unlimited learning
Sale ends in
strsplit
()
is that this method also returns the part of the string that matched
the pattern. Also, it only takes a single character string.## S3 method for class 'default':
splitByPattern(str, pattern, ...)
character
string to be split.character
string.strsplit
().rspCode <- "<body>Hello <%="world"%></body>"
rspParts <- splitByPattern(rspCode, pattern="<%.*%>")
cat(rspCode, "")
print(rspParts)
Run the code above in your browser using DataLab