Вы можете попробовать следующий подход и создать новый метод
let str = "abc abdf abcd";
String.prototype.includes2 = function(pattern,from =0,to = 0) {
to = this.indexOf(' ');
to = to >0?to: this.length();
return this.substring(from, to).includes(pattern);
}
console.log(str.includes2("abc",0,3));
console.log(str.includes2("abc",4,8));
console.log(str.includes2("abc"));
console.log(str.includes2("abd"))