Standard LibraryTypesstringMethodscapacityOn this pagecapacity Method of string. capacity() -> integer Returns the number of elements that the container has currently allocated space for.