C++ String Find()This function is used for finding a specified substring. SyntaxConsider two strings str1 and str2. Syntax would be : Parametersstr : String to be searched for. pos : It defines the position of the character at which to start the search. n : Number of characters in a string to be searched for. ch : It defines the character to search for. Return valueIt returns the position of the first character of first match. Example 1Let's see the simple example. Output: Java is the best programming language Position of the programming word is 17 Example 2Let's see simple example by passing position of a character as a parameter. Output: Mango is my favorite fruit Position of fruit is 21 Example 3Let's see simple example of finding a single character. Output: String contains : javatpoint Position of p is 5 Next TopicC++ Strings |
We provides tutorials and interview questions of all technology like java tutorial, android, java frameworks
G-13, 2nd Floor, Sec-3, Noida, UP, 201301, India