TrimConverter source

Trims a string of white space.

Example

Removes leading and trailing white space from a string.

var Converter= require("core/converter/converter").Converter,
TrimConverter = require("core/converter/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 a4679af

comments powered by Disqus

More help?

Can't find what you are looking for? Get in touch, we're more than happy in helping answer your questions.