⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.cpp

📁 在C++标准库<string>中
💻 CPP
字号:
/**
* @file main.cpp
* @brief StringTrim.h使用示例文件
* @author Hao Liming
* @date 2008-11-6 13:01:50
* @Version 0.1
* <pre><b>copyright: CASCO</b></pre>
* <pre><b>email: </b>haoliming@casco.com.cn</pre>
* <pre><b>company: </b>http://www.casco.com.cn</pre>
* <pre><b>All rights reserved.</b></pre>
* <pre><b>modification:</b></pre>
* <pre></pre>
*/

#include "StringTrim.h"
#include "string"
#include <iostream>
#include <windows.h>
int main()
{
	std::string test = "       Hello World!       ";
	std::cout << "转换前test字符串大小为" << test.length()<< std::endl;

	
	/** @brief 去掉首尾空格*/
    CASCO::trim(test);

	std::cout << "转换后test字符串大小为" << test<< std::endl;


	/** @brief 整个字符串空格*/

	/** @brief 去掉子串空格*/
	std::string test1 = "  a";
	CASCO::beginEndTrim(test1,1,1);
	std::cout<<"88";
	std::cout<<test1<<"99"<<std::endl;

	/** @brief 去掉子串空格*/
	std::string test2 = "  aaa   fa a";
	CASCO::startSizTrim(test2,0,11);
	std::cout<<"88";
	std::cout<<test2<<"99"<<std::endl;
	
	return 0;
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -