Skip to content

Instantly share code, notes, and snippets.

@clement-joye
Created May 15, 2021 12:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clement-joye/458cc94b84fc25b4078535e36954d102 to your computer and use it in GitHub Desktop.
Save clement-joye/458cc94b84fc25b4078535e36954d102 to your computer and use it in GitHub Desktop.
function SubtituteString(urlStr: string, json: { [key: string] : string }) {
Object.keys(json).forEach(function(key) {
urlStr = urlStr.replace('${' + key + '}', json[key])
})
return urlStr;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment