字符串处理技巧

  1. std::transform
    1. 头文件:<algorithm>
    2. transform函数
      1. std::transform(first1, last1, result, operate);
        1. first1:起始地址
        2. last1:结束地址
        3. result:结果(存入的)起始地址
        4. operate:操作内容(可以填写“tolower”“toupper”之类的,转换大小写)
  2. 大小写转换
    1. tolower
      1. 如果一个字符是大写字母,则将其变成小写
    2. toupper
      1. 如果一个字符是小写字母,则将其变成大写
posted @ 2019-07-13 17:25  guoshaoyang  阅读(174)  评论(0编辑  收藏  举报