Last active
April 2, 2020 09:11
-
-
Save adityatyagi/321803c238b08c0c7e03352d58737fd8 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 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