C++中string.h里面是否有函数能实现寻找特定字母的功能?

来源:百度知道 编辑:UC知道 时间:2024/05/29 01:25:00
哪位高手知道?请介绍一下string.h包里的一些内容,特别是strstr()的用法.
谢谢!

C++中的string是一个class
你先搞清楚:
#include< string >
#include< string.h >
#indlude< cstring >
三个的区别。

要找特定字母的话用#include< string >
包含string类。不是<string.h>

Clone Returns a reference to this instance of String.
Compare Overloaded. Compares two specified String objects.
CompareOrdinal Overloaded. Compares two String objects by evaluating the numeric values of the corresponding Char objects in each string.
CompareTo Overloaded. Compares this instance with a specified object or String and returns an indication of their relative values.
Concat Overloaded. Concatenates one or more instances of String, or the String representations of the values of one or more instances of Object.
Contains Returns a value indicating whether the specified String object occurs within this string.
Copy Creates a new instance of String with the same value as a specified String.