Created
June 29, 2016 09:45
-
-
Save lusan/082dd0c14427ec7219e860969f470293 to your computer and use it in GitHub Desktop.
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
var inputString = "dilip %s Kumar %s"; | |
var finalString; | |
function manipulateString(param) { | |
finalString = inputString; | |
for(var i = 0; i <= arguments.length; i++) { | |
finalString = finalString.replace('%s',arguments[i]); | |
} | |
return finalString; | |
} | |
console.log(manipulateString("is", "cool")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment