Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to write a C++ program of the 2nd picture using the string function strVar.subtr of the frist pic . Can someone please help
I need to write a C++ program of the 2nd picture using the string function strVar.subtr of the frist pic . Can someone please help me with that?
TABLE 71 Some string functions (continued) Expression Effect Returns the index of the first occurrence of str in strVar. If str is not found, the special value string: :npos is returned strVar.find (str) Returns the index of the first occurrence at or after pos where str is found in strVar strVar.find(str, pos) strVar.find first of (str, pos) Returns the index of the first occurrence of any character of strVar in str. The search starts at pos strVar.find first not of (str, pos) Returns the index of the first occurrence of any character of str not in strVar. The search starts at pos Inserts n occurrences of the character ch at strVar.insert (pos, ch)index pos into strVar; pos and n are of type string::size type; ch is a character Inserts all the characters of str at index pos into strVar strVar.insert (pos, str; Returns a value of type string::size_type giving the number of characters strVar strVar.length () Starting at index pos, replaces the next n characters of strVar with all the characters of str. If n> length of strVar, then all the characters until the end of strVar are replaced strVar.replace (pos, n, str); Returns a string that is a substring of strVar starting at pos. The length of the substring is at most len characters. If len is too large, it means "to the end" of the string in strVar strVar.substr (pos, len) Returns a value of type string::size type giving the number of characters strVar strVar.size () strVar.swap (strl) Swaps the contents of strVar and strl strl is a string variableStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started