STL learning summary string

1. When using, you need to add the header file #include<string>

2. Append the string at the end of the string object

    

Third, delete the string object

1. If you want to empty the string object, just assign it to empty directly.

2. Use the erase() method to delete the elements in the range pointed to by the iterator.

Fourth, the length () method returns the length of the string object. 

Five, replace the characters of the string object

    

6. Search the contents of the string object.

 


Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326038725&siteId=291194637