TrimConverter source

Trims a string of white space.

Example

Removes leading and trailing white space from a string.

var Converter= require("./converter").Converter,
TrimConverter = require("./converter").TrimConverter;
var str = "      Hello World     ";
var trimConverter = new TrimConverter();
console.log("After trim: " + trimConverter.convert(str));
// After trim: Hello World

Methods

convert(v) source

Trims the provided string and returns the new string.

Parameters:
Name Type Description
v string

The string to trim.

Returns:

this._convert(v)

revert(v) source

Reverts the conversion.

Parameters:
Name Type Description
v string

The string to revert.

Returns:

this._convert(v)

Generated from v0.14.14

Need help?

Can't find what you are looking for? Please contact us, we're more than happy to help answer your questions.