stringx
v0.0.1
Published
Yet another string utility dealing with startsWith, endsWith and etc.
Downloads
7
Maintainers
Readme
stringx
Yet another string utility dealing with startsWith, endsWith and etc.
#Installation
npm install stringx
#Usage
var stringx = require('./stringx');
describe('stringx Suite', function () {
beforeEach(function () {
});
afterEach(function () {
});
it('should work: startsWith', function () {
expect(stringx.startsWith('abcdefg', 'a')).toBeTruthy();
expect(stringx.startsWith('abcdefg', 'ab')).toBeTruthy();
expect(stringx.startsWith('abcdefg', '')).toBeTruthy();
expect(stringx.startsWith('abcdefg', 'x')).toBeFalsy();
expect(stringx.startsWith('abcdefg', 'g')).toBeFalsy();
});
it('should work: endsWith', function () {
expect(stringx.endsWith('abcdefg', 'g')).toBeTruthy();
expect(stringx.endsWith('abcdefg', 'fg')).toBeTruthy();
expect(stringx.endsWith('abcdefg', '')).toBeTruthy();
expect(stringx.endsWith('abcdefg', 'x')).toBeFalsy();
expect(stringx.endsWith('abcdefg', 'a')).toBeFalsy();
});
});