zoukankan      html  css  js  c++  java
  • string 大小写转换

    #include <string>  
    #include <algorithm>  
    using namespace std;  
    
    int main()  
    {  
            string strA = "yasaken@126.com";  
            string strB = "LURY@LENOVO.com";  
            printf("Before transform:
    ");  
            printf("strA:%s 
    ", strA.c_str());  
            printf("strB:%s 
    
    ", strB.c_str());  
    
            transform(strA.begin(), strA.end(), strA.begin(), ::toupper);  
            transform(strB.begin(), strB.end(), strB.begin(), ::toupper);  
            printf("After transform to toupper:
    ");  
            printf("strA:%s 
    ", strA.c_str());  
            printf("strB:%s 
    
    ", strB.c_str());  
    
            transform(strA.begin(), strA.end(), strA.begin(), ::tolower);  
            transform(strB.begin(), strB.end(), strB.begin(), ::tolower);  
            printf("After transform to lower:
    ");  
            printf("strA:%s 
    ", strA.c_str());  
            printf("strB:%s 
    
    ", strB.c_str());  
            return 0;  
    }
  • 相关阅读:
    bootstrap以及考试复习
    HTML复习
    驼峰命名法和模态对话框
    dom和bom
    dom习题复习和讲解
    DOM
    属性扩展
    sql防注入式攻击
    自动生成编号
    删除,修改,添加
  • 原文地址:https://www.cnblogs.com/laohaozi/p/12538148.html
Copyright © 2011-2022 走看看