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

jQuery - regex method

0 votes
7 views
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, ' ');

$('#forum-cat').html(replaceName);

Please log in or register to example this solution.

lazacode.org - Malaysia based Knowledge Exchange Platform, where you can share your finding or solution with other members of community.
...