Package Exports
- string-operations
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (string-operations) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
stringOperations
This library will do operation on string like padLeft and padRight
Truncate, replace all occurrences will be implemented sooner.
//
// Add Padding at the right of the string.
//
// Usage:
// stringOps.padRight(options)
//
// Where:
// options one or more of the following:
// value data which you want to pad- default value will be empty string ''
// padChar pad character which you want to append the value default value will be white space ' '
// maxLength Total length of data after padding
//
//
Example
var stringOps = require('string-operations');
var options = {
value: 'abcde',
padChar: ' ',
maxLength: '7'
};
var result = stringOps.padRight(options);
console.log(result);
// 'abcde '
var stringOps = require('string-operations');
var options = {
value: 'abcde',
padChar: '0',
maxLength: '7'
};
var result = stringOps.padLeft(options);
console.log(result);
// '00abcde'