示例代码如下:

 #include <boost/algorithm/algorithm.hpp>
#include <iostream>
using namespace std;
#include <string> void TimerTest()
{
// 字符串大小写转换;
string strTemp = "asdQWEghhh";
string strTemp1 = strTemp;
string strTemp2 = strTemp;
string strTemp3 = strTemp;
boost::to_upper(strTemp);
boost::to_lower(strTemp1);
string strTemp4 = boost::to_upper_copy(strTemp2); // 返回值变成大写,参数不变;
string strTemp5 = boost::to_lower_copy(strTemp3); // 返回值变成小写,参数不变;
}

boost 字符串大小写转换的更多相关文章

  1. linux bash shell:最方便的字符串大小写转换(lowercase/uppercase conversion) (转)

    原文地址:https://blog.csdn.net/10km/article/details/83384145 关于字符串大小写转换,是写 linux 脚本经常干的事儿,所以总想找个方便的方法让我少 ...

  2. 【转】Python 字符串大小写转换

    转载自:python 中字符串大小写转换 一.pyhton字符串的大小写转换, 常用的有以下几种方法: 1.对字符串中所有字符(仅对字母有效)的大小写转换,有两个方法: print 'just to ...

  3. [Swift]字符串大小写转换,同时实现本地化或设置语言环境

    在NSString中提供了3种字符串大小写转换方式:1. 转换字符串大小写2. 转换字符串大小写,并实现本地化3. 转换字符串大小写,并设置语言环境. 一. 转换字符串大小写如果只是想单纯的将字符串进 ...

  4. python 字符串大小写转换(不能使用swapcase()方法)

    python 3字符串大小写转换 要求不能使用swapcase()方法 #!/usr/bin/env python # -*- coding:utf-8 -*- # Author:Hiuhung Wa ...

  5. java字符串大小写转换的两种方法

    转载自:飞扬青春sina blogjava字符串大小写转换的两种方法 import java.io..* public class convertToPrintString {          pu ...

  6. std::string 字符串大小写转换(转)

    该问题归结为std::transform函数的使用 函数原型 template < class InputIterator, class OutputIterator, class UnaryO ...

  7. php字符串大小写转换

    strtoupper().strtolower().ucfirst().ucfirst().ucwords().mb_strtoupper().mb_strtolower()和mb_convert_c ...

  8. python 字符串 大小写转换

    总结 capitalize() 首字母大写,其余全部小写 upper() 全转换成大写 lower() 全转换成小写 title() 标题首字大写,如"i love python" ...

  9. python 字符串 大小写转换 以及一系列字符串操作技巧

    总结 capitalize() 首字母大写,其余全部小写 upper() 全转换成大写 lower() 全转换成小写 title() 标题首字大写,如"i love python" ...

随机推荐

  1. [JZOJ3347] 【NOI2013模拟】树的难题

    题目 题目大意 给你一棵树,每个节点有三种黑.白.灰三种颜色. 你要割掉一些边(每条边被割需要付出一定的代价),使得森林的每棵树满足: 没有黑点或至多一个白点. 思考历程 这题一看就知道是一个树形DP ...

  2. python 集合(set)

    1.集合的创建 集合是一个无序不重复元素的集.基本功能包括关系测试和消除重复元素. 创建集合:大括号或 set() 函数可以用来创建集合.注意:想要创建空集合,你必须使用 set() 而不是 {},后 ...

  3. spring源码读书笔记

    如果我们在web项目里面使用spring的话,通常会在web.xml里面配置一个listener. <listener> <listener-class> org.spring ...

  4. PAT甲级——A1114 Family Property【25】

    This time, you are supposed to help us collect the data for family-owned property. Given each person ...

  5. day3:python测试题

    1.Python的怎么单行注释和多行注释: 单行注释:# 多行注释: '''     '''      或者  “”“        ”“”    . 2.布尔值分别是什么 ? True    /Fa ...

  6. 03_springboot2.x日志处理

    1.日志框架 ​ 市场上存在非常多的日志框架.JUL(java.util.logging),JCL(Apache Commons Logging),Log4j,Log4j2,Logback.SLF4j ...

  7. JS时间比较大小

    目录 1. 时间比较 2. 时间戳比较 3. 日期比较方法 4. 参考 1. 时间比较 var curTime = new Date(); //把字符串格式转化为日期类 var starttime = ...

  8. 2019-11-12-浅谈-Windows-桌面端触摸架构演进

    title author date CreateTime categories 浅谈 Windows 桌面端触摸架构演进 lindexi 2019-11-12 14:37:31 +0800 2019- ...

  9. Ip- Linux必学的60个命令

    1.作用 ip是iproute2软件包里面的一个强大的网络配置工具,它能够替代一些传统的网络管理工具,例如ifconfig.route等,使用权限为超级用户.几乎所有的Linux发行版本都支持该命令. ...

  10. T2980 LR棋盘【Dp+空间/时间优化】

    Online Judge:未知 Label:Dp+滚动+前缀和优化 题目描述 有一个长度为1*n的棋盘,有一些棋子在上面,标记为L和R. 每次操作可以把标记为L的棋子,向左移动一格,把标记为R的棋子, ...