C++ String rfind()This function is used to find the string for the last occurrence of the sequence specified by its arguments. SyntaxConsider a string 'str' and key string 's'. Syntax would be: Parameterstr : str is a string object which is used in searching. pos : It defines the position of the last character at which to start searching. n : Number of characters to be considered in searching ch : Character value to be searched for. Example 1Let's see this simple example. Output: 39 Example 2Let's see an another simple example by passing character value. Output: 15 Example 3Let's see this example when position pos is mentioned in a parameter. Output: 20 Example 4Let's see this example when number of characters to match is specified by its arguments. Output: 27
Next TopicC++ Strings
|
JavaTpoint offers too many high quality services. Mail us on h[email protected], to get more information about given services.
JavaTpoint offers college campus training on Core Java, Advance Java, .Net, Android, Hadoop, PHP, Web Technology and Python. Please mail your requirement at [email protected].
Duration: 1 week to 2 week