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

jQuery - regex method

0 votes
15 views
added May 2 in Regex by LC Marshal Lieutenant (14,830 points)
edited Jul 13 by LC Marshal
//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 response this reference.

lazacode.org - Malaysia's programming knowledge sharing platform, where everyone can share their finding as reference to others.
...