C++ String clear()This function removes the elements, becomes an empty string. SyntaxConsider a string str. Syntax would be: ParameterThis function does not contain any parameter. Return valueThis function does not return any value. ExampleLet's see a simple example of clear() function: Output: Enter some lines about javaTpoint and write dot character to finish the sentence If you want to clear the text, press d This example shows how clear() function works. 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