C++ String resize()
This function is used to resize the string to the length of k characters.
Consider a string object str. To resize the string object, syntax would be :
This 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.
It does not return any value.
When k is shorter than length of the specified string.
When k is greater than the length of the specified string.
String value is javatpoint After resizing, string value is javatpoint tutorial