JSFiddle - React, Tailwind, and code Playground
JavaScript
var text="The this is red\nThis is blue\n";
var lines = text.split('\n');
if(lines.length) {
if(lines[0].match(/red/)) {
alert("The first line is red");
}
}
var text="The this is red\nThis is blue\n";
var lines = text.split('\n');
if(lines.length) {
if(lines[0].match(/red/)) {
alert("The first line is red");
}
}