C++ String clear()
This function removes the elements, becomes an empty string.
Consider a string str. Syntax would be:
This function does not contain any parameter.
This function does not return any value.
Let's see a simple example of clear() function:
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.
JavaTpoint offers too many high quality services. Mail us on [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