C++ String resize()This function is used to resize the string to the length of k characters. SyntaxConsider a string object str. To resize the string object, syntax would be : ParametersThis function contains two parameters.
If k is shorter than the length of the string, string length shortened to the length specified by k, removing all the characters beyond k. If k is larger than the length of the string, string length extended to the length specified by k. Return valueIt does not return any value. Example 1When k is shorter than length of the specified string. Example 2When k is greater than the length of the specified string. Output: String value is javatpoint After resizing, string value is javatpoint tutorial 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