let text =`...for(10)='200'
...for(10)='800'
...for(10)='8003'
`,
word = `'800'`;
let index = text.split(/[\r\n]+/).findIndex(str => str.includes(word));
alert(index);
Последний раз редактировалось рони, 08.08.2020 в 22:10.
let text =`...for(10)='200'
...for(10)='800'
...for(10)='8003'
`,
word = `'800'`;
let index = text.split(/[\r\n]+/).findIndex(str => str.includes(word));
alert(index);