Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 25 additions & 1 deletion dist/string.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,30 @@ string.js - Copyright (C) 2012-2014, JP Richardson <[email protected]>
charAt: function(index) {
return this.s.charAt(index);
},

mask: function(index,sign="*"){
var input = this.s;
var inputLength = input.length;
var sec = "";
if(index > 0){
var a = inputLength - index;
for(var i = 0;i<a;i++){
sec = sec.concat(sign);
}

return input.substr(0,index) + sec;
}
else{
var i;
var Index = Math.abs(index);
var c = (inputLength - Index);
for(i=0;i<c;i++){
sec = sec.concat(sign);
}
return sec + input.substr(c,inputLength) ;
}

},

chompLeft: function(prefix) {
var s = this.s;
Expand Down Expand Up @@ -1181,4 +1205,4 @@ string.js - Copyright (C) 2012-2014, JP Richardson <[email protected]>

},{"./_count":1,"./_splitLeft":2,"./_splitRight":3}]},{},[4])
(4)
});
});