我怎样才能提取这样的句子的一部分:
var sentence = "This is my sentence. I want to extract a part of it (in javascript !)";
var subSentence1 = "nt t";
var subSentence2 = "t (in javasc";
var result1 = f(sentence,subSentence1);
var result2 = f(sentence,subSentence2);
我想要:
结果1 =“想要”
和
result2 =“它(在javascript中”
谢谢