资料:http://journal.r-project.org/archive/2010-2/RJournal_2010-2_Wickham.pdf
## 基本操作
| 函数 | 用途 |
| ---- | ---- |
| str_c | 字符串拼接
| str_length |字符串长度
| str_sub |子串
| str_str |允许不同长度的子串做替换
| str_dup |复制字符串
| str_trim |字符串去除头尾空白
| str_pad | 字符串头尾加空白符
## 模式匹配
| 函数 | 用途 |
| ---- | ---- |
| str_detect | 查找子串
| str_locate / str_locate_all | 找到第一个匹配
| str_extract / str_extract_all | 找出第一个匹配的子串
| str_match / str_match_all | 取出括号里匹配的子串
| str_replace / str_replace_all | 替换子串
| str_split |分割字符串
| str_split_fixed |以固定宽度分割字符串
没有评论:
发表评论