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
|
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