Yet another string utility dealing with startsWith, endsWith and etc.
npm install stringxstringx
==========
Yet another string utility dealing with startsWith, endsWith and etc.
#Installationnpm install stringx
#Usage
``javascript
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();
});
});
``