##### cppreference.com

##### Search

Create account

##### Namespaces

- Page
- Discussion

##### Variants

##### Views

- View
- Edit
- History

##### Actions

# std::basic_string::pop_back

From cppreference.com
< cpp‎ | string‎ | basic string

void pop_back(); |  | (since C++11)

Removes the last character from the string.

Equivalent to erase(size()-1, 1), except the behavior is undefined if the string is empty.

### [edit] Parameters

(none)

### [edit] Return value

(none)

### [edit] Complexity

Constant.

### [edit] Exceptions

Does not throw

### [edit] See also

push_back | appends a character to the end (public member function) [edit]
erase | removes characters (public member function) [edit]

Retrieved from "http://en.cppreference.com/mwiki/index.php?title=cpp/string/basic_string/pop_back&oldid=75326"