How do I detect when the last value is found in the below function? I don't do jQuery! What I want is to add a pipe delimiter after each value is found but not the last value. So I'd have for example if it returns 3 values then I will get ==> value1|value2|value3 . The example below uses a console.log but it will actually be returning the value in a variable, in real life.
$(function() { $('[class*="solid-shape-large-rating-"]').each(function(i, e) { var result = this.className.match(/solid-shape-large-rating-(.*?)\s+/); console.log(result[1]); }); });
Open in new window