JS consigue una cadena antes del personaje
var str = "JavaScript is the programming language of the Web.";
// this will return string before the word programming
var result = str.split('programming')[0];
// result : "JavaScript is the ";
MeVyom