テキストの段落を表す文字列があります。
var paragraph = "It is important that the word cold is not partially selected where we search for the word old";
この段落で「単語」のインデックスを検索し、「単語」と完全に一致させたいと考えています。たとえば、「古い」を検索する場合。「コールド」の「古い」の一致は無効であるため、2 つではなく 1 つの結果しか取得できません。
テキストの段落を表す文字列があります。
var paragraph = "It is important that the word cold is not partially selected where we search for the word old";
この段落で「単語」のインデックスを検索し、「単語」と完全に一致させたいと考えています。たとえば、「古い」を検索する場合。「コールド」の「古い」の一致は無効であるため、2 つではなく 1 つの結果しか取得できません。