magic-increment
Incrementation and decrementation for strings.
Installation
In Browser:
or
Object MagicIncrement will defined in the global scope.
In Node.js:
npm install magic-increment
var MagicIncrement = ;
bower:
bower install magic-increment
inc
- {string} MagicIncrement.inc ( value )
Increment the argument value.
This incrementation uses alphabets [a-z] + [A-Z] and digits [0-9].
@param {string} value The value to increment.
@return {string} Return the incremented value.
console; // '100'console; // 'aaa'console; // 'a1'console; // 'Ba'
var s = 'X';for var i = 0; i < 10; i++ s = MagicIncrement; console;// Y// Z// AA// AB// AC// AD// AE// AF// AG// AH
dec
- {string} MagicIncrement.dec ( value )
Decrement the argument value.
This decrementation uses alphabets [a-z] + [A-Z] and digits [0-9].
@param {string} value The value to decrement.
@return {string} Return the decremented value.
console; // '99'console; // 'zz'console; // 'a0'console; // 'Az'
var s = 'AC';for var i = 0; i < 10; i++ s = MagicIncrement; console;// AB// AA// Z// Y// X// W// V// U// T// S
Demo
Test for Magic Increment (Demo)
License
MIT