How to remove whitespace from a text string in Python

pip install cloudmersive-convert-api-client
from __future__ import print_functionimport timeimport cloudmersive_convert_api_clientfrom import ApiExceptionfrom pprint import pprint# Configure API key authorization: Apikeyconfiguration = cloudmersive_convert_api_client.Configuration()configuration.api_key['Apikey'] = 'YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Apikey'] = 'Bearer'# create an instance of the API classapi_instance = cloudmersive_convert_api_client.EditTextApi(cloudmersive_convert_api_client.ApiClient(configuration))request = cloudmersive_convert_api_client.RemoveWhitespaceFromTextRequest() # RemoveWhitespaceFromTextRequest | Input requesttry:# Remove whitespace from text stringapi_response = api_instance.edit_text_remove_all_whitespace(request)pprint(api_response)except ApiException as e:print("Exception when calling EditTextApi->edit_text_remove_all_whitespace: %s\n" % e)




There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

AWS ManagedBlockchain + Hyperledger Explorer quickstart (1)

How to Convert EML to PNG in Swift

Simplified Deployments with OpenVINO™ Model Server and TensorFlow Serving

Life is a journey of twists and turns, peaks and valleys, mountains to climb and oceans to explore.

Why Do Organizations Scale So Poorly?

Hedging our bets on rpc latency

Github profil

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

More from Medium

Generate a EAN-8 code barcode as PNG file in Python

How to Receive WhatsApp messages using python and webhook

Benefits of Using Python for Software Development

Translate English to German Text with Deep Learning API