Standard LibraryTypesstringMethodsclearOn this pageclear Method of string. clear() -> void Clears all elements from the container.