auto increment string in javascript
function autoIncrementCustomId(lastRecordId){
let increasedNum = Number(lastRecordId.replace('ABC','')) + 1;
let kmsStr = lastRecordId.substr(0,3);
for(let i=0; i< 6 - increasedNum.toString().length; i++){
kmsStr = kmsStr+'0';
}
kmsStr = kmsStr + increasedNum.toString();
console.log(kmsStr);
}
autoIncrementCustomId('ABC009999')
Also in JavaScript:
- popper.min.js download
- Node require module
- undo npm run eject react
- Material-ui add circle icon
- build a trivia and answer javascript
- shadown reAct native
- how to create tab component in jquery
- using this to get name of the clicked element
- animation library react
- Iterate with JavaScript For Loops
- check if a key exists in an object javascript
- onchange not working input jquery
- js string does not contain
- get textarea value jquery
- how to delete a folder using node js
- callout react
- import { Plugins } from '@capacitor/core'; cannot find
- select option trigger in js
- how to shallow clone javascript class
- jwt token example in node js
- how to terminate a program in js
- kill all node processes
- span role link
- how to create my own filter in js