Skip to content

Instantly share code, notes, and snippets.

@adityatyagi adityatyagi/test2.js

Last active Apr 2, 2020
Embed
What would you like to do?
var a = "{37a00dcf-fc8a-48c0-b912-ab8c00fcd78e}";
function getContentFromStringWithBraces(stringWithBraces){
let contentWithinBraces = stringWithBraces.substring(stringWithBraces.lastIndexOf("{") + 1, stringWithBraces.lastIndexOf("}"));
return contentWithinBraces;
}
// label to print the time against
console.time('sampleLabel');
console.log(getContentFromStringWithBraces(a));
// exactly same labe
console.timeEnd('sampleLabel');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.