Generation

generate functionSat, 12 Nov 2022

Trim end of string

function stripTrailingSlash(str) { if(str.substr(-1) == '/') { return str.substr(0, str.length - 1); } return str; } stripTrailingSlash('https://stackoverflow.com')

Javascript
Generate More

Questions about programming?Chat with your personal AI assistant