Table 18.1. 大小写转换
算法名称 | 描述 | 函数 |
---|---|---|
to_upper | 转成大写 | to_upper_copy() to_upper() |
to_lower | 转成小写 | to_lower_copy() to_lower() |
Table 18.2. Trimming
算法名称 | 描述 | 函数 |
---|---|---|
trim_left | 去除字符串左边的空格字符 | trim_left_copy_if() trim_left_if() trim_left_copy() trim_left() |
trim_right | 去除字符串右边的空格字符 | trim_right_copy_if() trim_right_if() trim_right_copy() trim_right() |
trim | 去除字符串左右两边的空格字符 | trim_copy_if() trim_if() trim_copy() trim() |
Table 18.3.判断
算法名称 | 描述 | 函数 |
---|---|---|
starts_with | 一个字符串是否是另一字符串的前缀 | starts_with() istarts_with() |
ends_with | 一个字符串是否是另一字符串的后缀 | ends_with() iends_with() |
contains | 一个字符串是否被另一字符串包含 | contains() icontains() |
equals | 两个字符串是否相同 | equals() iequals() |
lexicographical_compare | 一个字符串是否小于另一字符串(按字典排序) | lexicographical_compare() ilexicographical_compare() |
all | 字符串中所有的字符是否都满足指定条件 | all() |
Table 18.4. 查找算法
算法名称 | 描述 | 函数 |
---|---|---|
find_first | 查找子串第一次在被查找串中出现的位置 | find_first() ifind_first() |
find_last | 查找子串最后一次在被查找串中的位置 | find_last() ifind_last() |
find_nth | 查找子串第n次出现在被查找串中的位置 | find_nth() ifind_nth() |
find_head | 返回字符串头部位置 | find_head() |
find_tail | 返回字符串尾部位置 | find_tail() |
find_token | 查找第一次匹配的token | find_token() |
find_regex | 使用正则表达式查找子串位置 | find_regex() |
find | 使用通用算法Finder查找子串位置 | find() |
Table 18.5. 删除/替换
Table 18.6. 切分
算法名称 | 描述 | 函数 |
---|---|---|
find_all | 查找/提取 所有匹配的子串 | find_all() ifind_all() find_all_regex() |
split | 切分字符串 | split() split_regex() |
iter_find | 使用Finder查找所有的子串并存入指定的容器中 | iter_find() |
iter_split | 使用Finder查找子串并把它作为分隔符切分字符串 | iter_split() |
Table 18.8. Finders(查找器)
Finder | 描述 | Generators |
---|---|---|
first_finder | 查找第一次匹配的字符串 | first_finder() |
last_finder | 查找最后一次匹配的字符串 | last_finder() |
nth_finder | 查找第n次匹配的字符串 | nth_finder() |
head_finder | 接收字符串头部 | head_finder() |
tail_finder | 接收字符串尾部 | tail_finder() |
token_finder | 在字符串中查找匹配的 token | token_finder() |
range_finder | 总是返回整个字符串 | range_finder() |
regex_finder | 使用正则表达式查找字符串 | regex_finder() |
Table 18.9. Formatters(格式化器)
Formatter | 描述 | Generators |
---|---|---|
const_formatter | 总是返回指定的字符串 | const_formatter() |
identity_formatter | 返回原字符串 | identity_formatter() |
empty_formatter | 总是返回空字符串 | empty_formatter() |
regex_formatter | 正则表达式格式化器,它用来与regex_finder配合使用 | regex_formatter() |
Table 18.10. Find Iterators
Iterator name | 描述 | Iterator class |
---|---|---|
find_iterator | Iterates through matching substrings in the input | find_iterator |
split_iterator | Iterates through gaps between matching substrings in the input | split_iterator |
Table 18.11. Predicates
Predicate name | 描述 | Generator |
---|---|---|
is_classified | Generic ctype mask based classification | is_classified() |
is_space | Recognize spaces | is_space() |
is_alnum | Recognize alphanumeric characters | is_alnum() |
is_alpha | Recognize letters | is_alpha() |
is_cntrl | Recognize control characters | is_cntrl() |
is_digit | Recognize decimal digits | is_digit() |
is_graph | Recognize graphical characters | is_graph() |
is_lower | Recognize lower case characters | is_lower() |
is_print | Recognize printable characters | is_print() |
is_punct | Recognize punctuation characters | is_punct() |
is_upper | Recognize uppercase characters | is_upper() |
is_xdigit | Recognize hexadecimal digits | is_xdigit() |