Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js remove trailing slash

let path = "/some/string/with-trailing-slash/"
path = path.replace(//$/, "") // /some/string/with-a-slash
// * * *
let path = "/some/string/without-a-trailing-slash"
path = path.replace(//$/, "") // /some/string/without-a-trailing-slash
 
PREVIOUS NEXT
Tagged: #js #remove #trailing #slash
ADD COMMENT
Topic
Name
9+8 =