Pangkas teks setelah kata tertentu di JS
var new_str = str.substring(0, str.indexOf("Example"));
Cloudy Capuchin
var new_str = str.substring(0, str.indexOf("Example"));
function trimmedContent(content, length) {
var trimmedString = content.substr(0, length);
return trimmedString.substr( 0, Math.min(trimmedString.length, trimmedString.lastIndexOf(' ')) );
};