Last active
April 2, 2020 09:11
-
-
Save adityatyagi/1af785c9ee87a41558909f9e06faddbe 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; | |
} | |
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