C++字符串几个操作
2016-04-07 14:22
357 查看
Convert from strings
stoi Convert string to integer (function template )
stol
Convert string to long int (function template )
stoul
Convert string to unsigned integer (function template )
stoll
Convert string to long long (function template )
stoull
Convert string to unsigned long long (function template )
stof
Convert string to float (function template )
stod
Convert string to double (function template )
stold Convert
string to long double (function template )
Convert to strings
to_string Convert numerical value to string (function )
to_wstring
Convert numerical value to wide string (function )
Modifiers:
operator+=
Append to string (public member function )
append
Append to string (public member function )
push_back
Append character to string (public member function )
assign
Assign content to string (public member function )
insert
Insert into string (public member function )
erase
Erase characters from string (public member function )
replace
Replace portion of string (public member function )
swap
Swap string values (public member function )
pop_back
Delete last character (public member function )
String operations:
c_str
Get C string equivalent (public member function )
data
Get string data (public member function )
get_allocator
Get allocator (public member function )
copy
Copy sequence of characters from string (public member function )
find
Find content in string (public member function )
rfind
Find last occurrence of content in string (public member function )
find_first_of
Find character in string (public member function )
find_last_of
Find character in string from the end (public member function )
find_first_not_of
Find absence of character in string (public member function )
find_last_not_of
Find non-matching character in string from the end (public member function )
substr
Generate substring (public member function )
compare
Compare strings (public member function )
substr是取子串返回子串结果;
find是从指定下表开始,查找匹配子串,并返回匹配的子串下标
replace,是把字符串的从下标(i,j)替换为给出的子串
相关文章推荐
- Cppslqite的使用
- C++ 快速排序实现
- c++简单的ATL COM开发和调用实例
- VC++ windows开机自启动设置
- c++ union(联合体)
- C++类和对象的介绍
- 关联式容器map/multimap
- 关联式容器set/multiset
- OC语言实现指纹识别
- 快速排序(C++实现)
- 关于C语言程序中.h文件的总结
- C++ Unicode SBCS 函数对照表
- c++中的const/const_cast
- 读深入C++对象模型的总结
- C++三元运算符?:
- C++第3次作业
- 機器學習基石(Machine Learning Foundations) 机器学习基石 作业三 Q13-15 C++实现
- C++作业3
- c++ PrimerPlus 第六版中文版编程习题答案
- 第1课 学习 C++ 的意义