Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

string-mask javascript

var cardnumber = '4567 6365 7987 3783';
var first4 = cardnumber.substring(0, 4);
var last5 = cardnumber.substring(cardnumber.length - 5);

mask = cardnumber.substring(4, cardnumber.length - 5).replace(/d/g,"*");
console.log(first4 + mask + last5);
 Run code snippet
Comment

PREVIOUS NEXT
Code Example
Javascript :: javascript array to string 
Javascript :: regex for email validation 
Javascript :: remove comma from number javascript 
Javascript :: trigger input javascript 
Javascript :: is typescript faster than javascript 
Javascript :: How to hthe amount of users online in discordjs 
Javascript :: javascript for of 
Javascript :: react js onclick call two functions 
Javascript :: javascript create array of objects from multiple arrays 
Javascript :: rm -rf node_modules 
Javascript :: javascript reduce fraction 
Javascript :: using bootstrap in react 
Javascript :: dynamic folder import javascript 
Javascript :: sortby vue 
Javascript :: axios network error react native 
Javascript :: javascript setattribute onclick function with parameters 
Javascript :: joi validation 
Javascript :: change span value javascript 
Javascript :: cannot get issue in nodejs 
Javascript :: add a Google Font to a VueJS 
Javascript :: split decimal value in javascript 
Javascript :: jquery append div 
Javascript :: complex json example 
Javascript :: firebase order by key descending 
Javascript :: Get LocalStorage from WebView react native 
Javascript :: npm numeral 
Javascript :: pass props in link next js 
Javascript :: javascript consecutive numbers in array 
Javascript :: javascript date convert to unix 
Javascript :: set a value in session using javascript 
ADD CONTENT
Topic
Content
Source link
Name
7+5 =