Last active
March 1, 2016 09:03
-
-
Save Kasahs/31a13b471b23e3f199ff to your computer and use it in GitHub Desktop.
mask all but last 4 characters of a string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// source: http://stackoverflow.com/a/27545357/2317794 | |
var str = "1238127397812378" | |
str = str.replace(/\d(?=\d{4})/g, "*"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment