js ottenere la stringa prima di carattere
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 ";
javascript ottenere tutti i caratteri prima di un certo
// say you wanted to collect all the chars before a slash (/).
myString = "12345.67890";
newString = myString.substring(0, myString.indexOf('/'));
console.log(newString);
// returns "12345"