Requests the string to reduce its capacity to fit the size.
The request is non-binding. The string won't become smaller than the string byte length.
Desired size.
auto s = String("Die Alten lasen laut."); assert(s.capacity == 21); s.reserve(30); s.shrink(25); assert(s.capacity == 25); s.shrink(18); assert(s.capacity == 21); s.shrink(22); assert(s.capacity == 21);
See Implementation
Requests the string to reduce its capacity to fit the size.
The request is non-binding. The string won't become smaller than the string byte length.