How to trim leading and trailing Whitespace from a Text String in Node.JS

npm install cloudmersive-convert-api-client --save
var CloudmersiveConvertApiClient = require('cloudmersive-convert-api-client');var defaultClient = CloudmersiveConvertApiClient.ApiClient.instance;// Configure API key authorization: Apikeyvar Apikey = defaultClient.authentications['Apikey'];Apikey.apiKey = 'YOUR API KEY';// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)//Apikey.apiKeyPrefix = 'Token';var apiInstance = new CloudmersiveConvertApiClient.EditTextApi();var request = new CloudmersiveConvertApiClient.RemoveWhitespaceFromTextRequest(); // RemoveWhitespaceFromTextRequest | Input requestvar callback = function(error, data, response) {if (error) {console.error(error);} else {console.log('API called successfully. Returned data: ' + data);}};apiInstance.editTextTrimWhitespace(request, callback);

--

--

--

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

Devblog 40: Cool charts & cool waters!

Authentication in Laravel-Vue.js non-SPA Using Passport

How to generate near keys using near shell and authorize access

JavaScript: Understand Promise

Compound.js

Announcing Compound.js a JavaScript SDK for Ethereum and Compound

November 3rd, 2021, Ecosystem Updates for SORA, Polkaswap, and Fearless Wallet

Implementing Angular template references in AngularJS with a 10-line directive

Express API with Secure JWT Access and Refresh Token

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
Cloudmersive

Cloudmersive

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

More from Medium

How to Lookup EAN Barcode Value & Return Product Data with JavaScript

Contributing to Open-Source Projects on GitHub

GitHub logo

What is JWT. How to implement JWT based authentication in NodeJs?

How to implement JWT based authentication in NodeJs

Bug hunt: Ext JS Simlets and omitting the status code