0

Is there a built in method in Typescript that searches a string array and finds all items that contain the search string. e.g.

var myarray = ["apple", "orange", "app"];
var searchKey = "app"

this search key should return the array ["apple", "app"]

doorman
  • 15,707
  • 22
  • 80
  • 145
  • 4
    Dupe: [In javascript, how do you search an array for a substring match](https://stackoverflow.com/questions/4556099/in-javascript-how-do-you-search-an-array-for-a-substring-match) – Tyler Roper Jan 22 '20 at 16:31
  • 1
    There isn't a single function that just does this. But you can build it with `filter()` and `indexOf()`. – Code-Apprentice Jan 22 '20 at 16:36

0 Answers0