Strings.trim()

Trim trailing and leading whitespace from a string.

Usage

Hover over inputs/exits for more info.

var Strings = require('machinepack-strings');


// Trim trailing and leading whitespace from a string.

Strings.trim({

string: ' I went to the store to get some more milk. ',

}).exec({

// An unexpected error occurred.

error: function (err) {

 

},

// OK.

success: function (result) {

 

},

});

Inputs

string required

The string to trim.

'   I went to the store to get some more milk.     '

Exits

error

An unexpected error occurred.

success

OK.

'I went to the store to get some more milk.'