string对象易错点
来源:互联网 发布:vb中str是什么意思 编辑:程序博客网 时间:2024/05/18 01:35
1、当进行string对象和字符串字面值混合连接操作时,+操作的左右操作数必须有一个是string类型的:
string s1 = "hello";
string s2 ="word";
string s3 = s1+","; //是正确的
string s4 = "hello" + ",";//错误的
string s5 = s1+"," + "word";//正确的.仔细想想过程就知道了
string s6 = "hello" + ","+s2;//错误
2、string的长度大小 以及取位置上的值最好都用string::size_type
3、string对象常用头文件cctype:
isalnum(c):如果c是字母或者数字,则为True
isalpha(c): 如果是字母则为true
iscntrl(c):如果是控制符则为true
isdigit(c):数字则为true
isgraph(c):不是空格但可打印则为true
islower(c):小写字母
isprint(c);可打印
ispunct : 是标点符号
isspace(c) : 是空格
isupper :大写字母
isxdigit : 十六进制数
tolower() toupper() :大小写转化
- string对象易错点
- string对象
- String 对象
- String对象
- String对象
- string对象
- String对象
- String对象
- String对象
- string对象
- String()对象
- string对象
- String对象
- String对象
- String常量和String对象
- 正则表达式对象&&String对象
- JavaScript 对象☞String 对象
- JavaScript内置对象-string对象
- ubuntu server 12.04固定ip、dns
- UINavigationController使用详解
- Oracle 表的常见操作
- HDU1698 Just a Hook 解题报告--线段树
- 基于BVH驱动的OGRE骨骼动画
- string对象易错点
- HDU 1852 Beijing 2008 数论
- 2013 多校第六场 hdu 4662 MU Puzzle
- 使用autoit解决webdriver文件上传问题
- USACO 2.2.3 Runaround Numbers 循环数
- hdu1104Remainder (BFS)
- Struts2 <s:actionerror>标签覆盖
- 一道C机试题目
- 使用ocx(host ocx)