C++基础教程之string
一
string中方法
https://jingyan.baidu.com/article/a65957f437070d24e77f9b76.html
c++参考手册
http://www.cplusplus.com/reference/string/string/append/
string赋值方法
https://blog.csdn.net/qq_36409711/article/details/72625140
string清空方法
https://blog.csdn.net/u010821666/article/details/77934510/
string判空
https://blog.csdn.net/qq_28351609/article/details/84770537
string理解
https://blog.csdn.net/qq_31930499/article/details/80374310
二
c/c++数字与字符串的准换
整理:https://www.cnblogs.com/StLovaer/p/11398993.html
注意:append的参数可以是const *char,返回值是string,
当一些c函数不能用string作为参数,可以考虑利用append(参数看reference)
较全文章
https://www.cnblogs.com/johngu/p/7878029.html
string.c_str(在用C中,atoi等等,无string类型用的到)
https://www.cnblogs.com/newzol/p/8686076.html
tostring/stoi(数字转字符)
http://c.biancheng.net/view/1527.html
https://blog.csdn.net/w55100/article/details/79886788
https://blog.csdn.net/baidu_34884208/article/details/88342844
atoi
http://c.biancheng.net/cpp/html/125.html
strtol()、ltoa()与sprintf()—刷题必备
https://blog.csdn.net/hechao3225/article/details/54707990
三
分割(读入数据)
stringstream/ sprintf()/sscanf()
https://www.cnblogs.com/houchen/p/8984164.html
stringstream
https://blog.csdn.net/shs1992shs/article/details/83051298
https://www.cnblogs.com/liangf27/p/9356849.html(int 与 string直接转换)
sscanf详解
https://blog.csdn.net/pengnanzheng/article/details/81120890
strtok、strtok_s、strtok_r 字符串分割函数(C)
https://blog.csdn.net/hustfoxy/article/details/23473805
https://blog.csdn.net/ChillPolaris/article/details/79830812
scanf(“%s",)与gets()输入字符串的区别,以及与getchar()吸收回车键的搭配
https://blog.csdn.net/BBHHTT/article/details/75671653
四
**%s 与 %ls的区别 **
https://codeday.me/bug/20190217/660477.html
https://blog.csdn.net/lw02nju/article/details/4384175/
五、char——转———>string
#include <iostream>
#include <string>
using namespace std;
int main()
{
char ch='x';
string str="";//空字符串
str.append(1,ch);//1表示向末尾添加字符的数量是1,即向末尾添加一个ch字符
cout<<str<<endl;
}