香港中老年女艺人名单:C++中string.h里面是否有函数能实现寻找特定字母的功能?

来源:百度文库 编辑:高考问答 时间:2024/04/29 08:01:16
哪位高手知道?请介绍一下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.
CopyTo Copies a specified number of characters from a specified position in this instance to a specified position in an array of Unicode characters.
EndsWith Overloaded. Determines whether the end of an instance of String matches a specified string.
Equals Overloaded. Overridden. Determines whether two String objects have the same value.
Format Overloaded. Replaces each format item in a specified String with the text equivalent of a corresponding object's value.
GetEnumerator Retrieves an object that can iterate through the individual characters in this string.
GetHashCode Overridden. Returns the hash code for this string.
GetType Gets the Type of the current instance. (Inherited from Object.)
GetTypeCode Returns the TypeCode for class String.
IndexOf Overloaded. Reports the index of the first occurrence of a String, or one or more characters, within this string.
IndexOfAny Overloaded. Reports the index of the first occurrence in this instance of any character in a specified array of Unicode characters.
Insert Inserts a specified instance of String at a specified index position in this instance.
Intern Retrieves the system's reference to the specified String.
IsInterned Retrieves a reference to a specified String.
IsNormalized Overloaded. Indicates whether this string is in a particular Unicode normalization form.
IsNullOrEmpty Indicates whether the specified String object is a null reference (Nothing in Visual Basic) or an Empty string.
Join Overloaded. Concatenates a specified separator String between each element of a specified String array, yielding a single concatenated string.
LastIndexOf Overloaded. Reports the index position of the last occurrence of a specified Unicode character or String within this instance.
LastIndexOfAny Overloaded. Reports the index position of the last occurrence in this instance of one or more characters specified in a Unicode array.
Normalize Overloaded. Returns a new string whose binary representation is in a particular Unicode normalization form.
op_Equality Determines whether two specified String objects have the same value.
op_Inequality Determines whether two specified String objects have different values.
PadLeft Overloaded. Right-aligns the characters in this instance, padding on the left with spaces or a specified Unicode character for a specified total length.
PadRight Overloaded. Left-aligns the characters in this string, padding on the right with spaces or a specified Unicode character, for a specified total length.
ReferenceEquals Determines whether the specified Object instances are the same instance. (Inherited from Object.)
Remove Overloaded. Deletes a specified number of characters from this instance.
Replace Overloaded. Replaces all occurrences of a specified Unicode character or String in this instance, with another specified Unicode character or String.
Split Overloaded. Returns a String array containing the substrings in this instance that are delimited by elements of a specified Char or String array.
StartsWith Overloaded. Determines whether the beginning of an instance of String matches a specified string.
Substring Overloaded. Retrieves a substring from this instance.
ToCharArray Overloaded. Copies the characters in this instance to a Unicode character array.
ToLower Overloaded. Returns a copy of this String converted to lowercase.
ToLowerInvariant Returns a copy of this String object converted to lowercase using the casing rules of the invariant culture.
ToString Overloaded. Overridden. Converts the value of this instance to a String.
ToUpper Overloaded. Returns a copy of this String converted to uppercase.
ToUpperInvariant Returns a copy of this String object converted to uppercase using the casing rules of the invariant culture.
Trim Overloaded. Removes all occurrences of a set of specified characters from the beginning and end of this instance.
TrimEnd Removes all occurrences of a set of characters specified in an array from the end of this instance.
TrimStart Removes all occurrences of a set of characters specified in an array from the beginning of this instance.

具体功能太多太多了。。用什么查什么。msdn

高手不在,不用问了,