C++ Strings(字符串)
Constructors | 构造函数,用于字符串初始化 |
Operators | 操作符,用于字符串比较和赋值 |
append() | 在字符串的末尾添加文本 |
assign() | 为字符串赋新值 |
at() | 按给定索引值返回字符 |
begin() | 返回一个迭代器,指向第一个字符 |
c_str() | 将字符串以C字符数组的形式返回 |
capacity() | 返回重新分配空间前的字符容量 |
compare() | 比较两个字符串 |
copy() | 将内容复制为一个字符数组 |
data() | 返回内容的字符数组形式 |
empty() | 如果字符串为空,返回真 |
end() | 返回一个迭代器,指向字符串的末尾。(最后一个字符的下一个位置) |
erase() | 删除字符 |
find() | 在字符串中查找字符 |
find_first_of() | 查找第一个与value中的某值相等的字符 |
find_first_not_of() | 查找第一个与value中的所有值都不相等的字符 |
find_last_of() | 查找最后一个与value中的某值相等的字符 |
find_last_not_of() | 查找最后一个与value中的所有值都不相等的字符 |
get_allocator() | 返回配置器 |
insert() | 插入字符 |
length() | 返回字符串的长度 |
max_size() | 返回字符的最大可能个数 |
rbegin() | 返回一个逆向迭代器,指向最后一个字符 |
rend() | 返回一个逆向迭代器,指向第一个元素的前一个位置 |
replace() | 替换字符 |
reserve() | 保留一定容量以容纳字符串(设置capacity值) |
resize() | 重新设置字符串的大小 |
rfind() | 查找最后一个与value相等的字符(逆向查找) |
size() | 返回字符串中字符的数量 |
substr() | 返回某个子字符串 |
swap() | 交换两个字符串的内容 |
C++ Strings(字符串)的更多相关文章
- [LeetCode] Add Strings 字符串相加
Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. ...
- [LeetCode] Multiply Strings 字符串相乘
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: Th ...
- Codeforces Round #358 (Div. 2) D. Alyona and Strings 字符串dp
题目链接: 题目 D. Alyona and Strings time limit per test2 seconds memory limit per test256 megabytes input ...
- 【LeetCode每天一题】Multiply Strings(字符串乘法)
Given two non-negative integers num1 and num2 represented as strings, return the product of num1 and ...
- [LeetCode] 43. Multiply Strings ☆☆☆(字符串相乘)
转载:43. Multiply Strings 题目描述 就是两个数相乘,输出结果,只不过数字很大很大,都是用 String 存储的.也就是传说中的大数相乘. 解法一 我们就模仿我们在纸上做乘法的过程 ...
- LeetCode OJ:Multiply Strings (字符串乘法)
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: Th ...
- [Leetcode] Multiply strings 字符串对应数字相乘
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: Th ...
- Multiply Strings(字符串乘法模拟,包含了加法模拟)
Given two numbers represented as strings, return multiplication of the numbers as a string. Note: Th ...
- [LeetCode] 415. Add Strings 字符串相加
Given two non-negative numbers num1 and num2 represented as string, return the sum of num1 and num2. ...
- [LeetCode] 43. Multiply Strings 字符串相乘
Given two non-negative integers num1 and num2represented as strings, return the product of num1 and ...
随机推荐
- iOS开发——数据持久化Swift篇&(二)沙盒文件
沙盒文件 //******************** 5.2 文件操作 func use_FileOperations() { //1.获取程序的Home目录 let homeDirectory = ...
- nginx1.4.6+php5.5.11+mysql5.6.17+mecache+opcache
要用到的软件:libiconv-1.13.tar.gz libmcrypt-2.5.8.tar.gz mcrypt-2.6.8.tar.gz mhash-0.9.9.9.tar.gz memcache ...
- Handle类的用法
android中Handle类的用法 当我们在处理下载或是其他需要长时间执行的任务时,如果直接把处理函数放Activity的OnCreate或是OnStart中,会导致执行过程中整个Activity无 ...
- OC之category的用法
简介 实例 好处 一.category简介 动态的为某个已经存在的类增加方法,不可以增加成员变量 二.实例 // // Student+CatetoryStudent.h // Category // ...
- Android 使用 HTTP 协议访问网络
正在看<第一行代码>,记录一下使用 HTTP 协议访问网络的内容吧! 在Android发送Http请求有两种方式,HttpURLConnection和HttpClient. 1.使用Htt ...
- Linux下VI的使用
vi使用手册 VI是unix上最常用的文本编辑工具,作为unix软件测试人员,有必要熟练掌握它.进入vi的命令 vi filename :打开或新建文件,并将光标置于第一行首 vi +n filena ...
- LearnMVC5-AddController
原创文章,转载必需注明出处:http://www.ncloud.hk/%E6%8A%80%E6%9C%AF%E5%88%86%E4%BA%AB/learnmvc5-addcontroller/ 本人是 ...
- oracle PL/SQL(procedure language/SQL)程序设计
PL/SQL(procedure language/SQL)语言是Oracle对SQL语言的过程化扩充,是一个完整的编程语言.PL/SQL实现了过程化语句(如分支.循环等)与SQL语句的无缝连接,将过 ...
- PHP将解析xml变为数组方法
最近想要做一个插件机制,需要用到xml,在解析xml时候需要转换为数组,特意记录一个此种解析方式 xml文件 <?xml version="1.0" encoding=&qu ...
- codeforces 590B B. Chip 'n Dale Rescue Rangers(二分+计算几何)
题目链接: B. Chip 'n Dale Rescue Rangers time limit per test 1 second memory limit per test 256 megabyte ...