Skip to content

Instantly share code, notes, and snippets.

@adityatyagi
Last active April 2, 2020 09:11
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 adityatyagi/1af785c9ee87a41558909f9e06faddbe to your computer and use it in GitHub Desktop.
Save adityatyagi/1af785c9ee87a41558909f9e06faddbe to your computer and use it in GitHub Desktop.
var a = "{37a00dcf-fc8a-48c0-b912-ab8c00fcd78e}";
function getContentFromStringWithBraces(stringWithBraces){
let contentWithinBraces = stringWithBraces.substring(stringWithBraces.lastIndexOf("{") + 1, stringWithBraces.lastIndexOf("}"));
return contentWithinBraces;
}
console.time();
console.log(getContentFromStringWithBraces(a));
console.timeEnd();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment