JSFiddle - React, Tailwind, and code Playground
by Daedalus
JavaScript
var string = 'test/again/';
var result = string.replace(/[^\/]+\/$/, '');
document.write(result);
by Daedalus
var string = 'test/again/';
var result = string.replace(/[^\/]+\/$/, '');
document.write(result);