title: how to search by some of the characters in each cell not the whole word
body: <p>Here is a script file (JavaScript) I had loaded from the internet. it use with another HTML file to search data in google sheet. I have done all process and can run a web apps to search the data.</p>
  <p>but it has only one problem that when searching you have to put a &quot;full character&quot; in any cell then it will show the data. for instance, if in the cell have &quot;123456&quot; in the search input you have to type &quot;123456&quot; only then it will show the data but if you type only &quot;123&quot; or &quot;2345&quot; the search will not match with this cell.</p>
  <p>how could I change this script so that when I search can type only some character no need to type the full character in the cell an it still show that data. if &quot;123456&quot; in a cell but can type only &quot;123&quot; or &quot;456&quot; and it still match with this cell.</p>
  <p>Thank you very much.</p>
  <pre><code>function doGet() {
    return HtmlService.createTemplateFromFile('Index').evaluate();
  }
  
  
  /* PROCESS FORM */
  function processForm(formObject){  
    var result = &quot;&quot;;
    if(formObject.searchtext){//Execute if form passes search text
        result = search(formObject.searchtext);
    }
    return result;
  }
  
  //SEARCH FOR MATCHED CONTENTS 
  function search(searchtext){
    var spreadsheetId   = '1q5TzCH_om_J8nX47XPUrJIyCBo5TZnYa5lCqsBGhGx8'; //** CHANGE !!!
    var dataRage        = 'A2:J126';                                    //** CHANGE !!!
    var data = Sheets.Spreadsheets.Values.get(spreadsheetId, dataRage).values;
    var ar = [];
    
    data.forEach(function(f) {
      if (~f.indexOf(searchtext)) {
        ar.push(f);
      }
    });
    return ar;
  }
  </code></pre>