发布网友 发布时间:2022-04-24 06:33
共4个回答
热心网友 时间:2022-06-16 23:56
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()交换两个字符串的内容
热心网友 时间:2022-06-16 23:56
c++ <string.h>中包括哪些函数? 答:常用函数如下: strlen 求字符串长度 strcmp 比较2个字符串是否一样 strcat 字符串连接操作 strcpy 字符串拷贝操作 strstr 查询子串 具体的详细例子,以下地址有详细用法。http://ke.baidu.com/view/1728868.htm
热心网友 时间:2022-06-16 23:57
ReferenceTypedefsstringA type that describes a specialization of the template class basic_string with elements of type char as a string.wstringA type that describes a specialization of the template class basic_string with elements of type wchar_t as a wstring.Operatorsoperator+Concatenates two string objects.operator!=Tests if the string object on the left side of the operator is not equal to the string object on the right side.operator==Tests if the string object on the left side of the operator is equal to the string object on the right side.operator<Tests if the string object on the left side of the operator is less than to the string object on the right side.operator<=Tests if the string object on the left side of the operator is less than or equal to the string object on the right side.operator<<A template function that inserts a string into the output stream.operator>Tests if the string object on the left side of the operator is greater than to the string object on the right side.operator>=Tests if the string object on the left side of the operator is greater than or equal to the string object on the right side.operator>>A template function that extracts a string from the input stream.Specialized Template FunctionsswapExchanges the arrays of characters of two strings.FunctionsgetlineExtract strings from the input stream line by line.Classesbasic_string ClassA template class that describes objects that can store a sequence of arbitrary character-like objects.char_traits ClassA template class that describes attributes associated with a character of type CharTypeSpecializationschar_traits<char> ClassA class that is a specialization of the template class char_traits<CharType> to an element of type char.char_traits<wchar_t> ClassA class that is a specialization of the template class char_traits<CharType> to an element of type wchar_t.
热心网友 时间:2022-06-16 23:57
你说错了,应该是String.h头文件.想知道里头有多少函数,你可以直接在编译器的安装目录搜:String.h文件然后打开来查不就知道了.