Are you first timer at Why not join us and start exchange your knowledge with everyone. Register today!

jQuery - regex method

0 votes
added May 2 in jQuery by LC Marshal First Warrant Officer (8,170 points)

Replace character in string with regex

var getcatName = $(location).attr('href'),
    getCatParts = getcatName.split("/"),
    endName = getCatParts[getCatParts.length-1],
    replaceName = endName.replace(/\-/g, ' ');


Please log in or register to example this solution. - Malaysia based Knowledge Exchange Platform, where you can share your finding or solution with other members of community.