ar text = " Addfsdf sdfsd ggsdf bbfdn gnfd n mmasvms smfms \
martijn adsljkdsafa martijn sdjklfa sdfjl asdjf";
var myName = "mason";
var hits = [];
for (var i = 0; i < text.length; i++){
if (text[i] === myName[0]){
for (var j = i ; j < (myName.length + i); j++) {
hits.push(text[j]);
}
}
}
李晓健
相关分类