Created
January 2, 2019 06:10
-
-
Save squalvj/c71738e4515e3d4be13ab78cb82bbda0 to your computer and use it in GitHub Desktop.
Take the last string using split and splice
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
const url = 'auth/user/ucok'; | |
const lastStr = url.split("/").slice(-1)[0]; | |
// output 'ucok' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment