How to get part of a string to a given word?

Was like such questions, but I have not found.
Recall, please. For example, there is a line "blablaTest". How do I get the entire string to "Test" ?

Thank you in advance
June 10th 19 at 16:02
2 answers
June 10th 19 at 16:04
Solution
your_string.substr(0, your_string.indexOf(keyword) );
June 10th 19 at 16:06
Solution
your_string.match(/^.*(?=Test)/);

Find more questions by tags JavaScript