JSFiddle - React, Tailwind, and code Playground
JavaScript
strng = "I have been working here till last six months"
text = ["since", "till", "until"]
var result;
for(var x = 0; x < text.length; x++){
if(strng.indexOf(text[x]) > -1){
result = text[x];
break;
}
}
alert(result);