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篇&(三)CATransition动画
CATransition动画 // MARK: - CATransition动画 // /* 动画样式 */ // let kCATransitionFade: NSString! //翻页 // l ...
- TIDB ---NEW SQL
https://github.com/pingcap/tidb http://www.pingcap.com/ Quick Start Run TiDB with Docker You can qui ...
- ecshop被加入了黑链
朋友一个ecshop网站被攻击了,查看代码如下: <?php $password = "1";//设置密码 error_reporting(E_ERROR); header( ...
- 计算圆周率 Pi (π)值, 精确到小数点后 10000 位 只需要 30 多句代码
大家都知道π=3.1415926……无穷多位, 历史上很多人都在计算这个数, 一直认为是一个非常复杂的问题.现在有了电脑, 这个问题就简单了.电脑可以利用级数计算出很多高精度的值, 有关级数的问题请参 ...
- 关于解决Permission is only granted to system apps
一句话,clean一下这个Project!就OK了…… 不要被假象迷惑!
- 倒数计数器-CountDownLatch
最近写一个多线程程序,老是MAIN方法执行完了子线程还没执行完(不知道以前怎么玩儿的),得不到最终结果,于是找到了CountDownLatch CountDownLatch是一个同步辅助类,java. ...
- C++ atol
函数名: atol 功 能: 把字符串转换成长整型数 用 法: long atol(const char *nptr); 简介编辑 相关函数: atof,atoi,strtod,strtol,st ...
- 1.5.4 什么是Filter--过滤器
什么是Filter--过滤器 像分词器(tokenizer)一样,过滤器(filter)消耗输入,产生token流.过滤器同样从org.apache.lucene.analysis.TokenStre ...
- How to setup ELM327 Bluetooth WiFi for Android software Torque
1. Install OBDII 2. Install Android Software Torque a) Copy software to phone from CD b) ...
- Android(java)学习笔记68:同步代码块 和 同步方法 的应用
1. 同步代码块 和 同步方法 代码示例: (1)目标类,如下: package cn.himi.text; public class SellTicket implements Runnable { ...