title: Google AppScript's Sheet.getName() returns object instead of string
body: <p>I'm trying to find a specific sheet in my SS by characters contained in it.</p>
  
  <p>I have the following function:</p>
  
  <pre><code>function findSheetResponse()
  {
    var ss = SpreadsheetApp.getActiveSpreadsheet();
    var allsheets = ss.getSheets();
    for(i in allsheets)
    {
      var responsesheet = new String;
      responsesheet = allsheets[i].getName();
      if(responsesheet.indexof("Form Responses")&gt;-1)
      {
        Logger.log(responsesheet);
      }
      else
      {
      }       
    }    
  }
  </code></pre>
  
  <p>This is the error given by the execution</p>
  
  <pre><code>TypeError: Cannot find function indexof in object Form Responses 10. (line 19, file "Code")
  </code></pre>
  
  <p>In don't get it. <a href="https://developers.google.com/apps-script/reference/spreadsheet/named-range#getName()" rel="nofollow noreferrer">getName()In the docs,  is supposed to return a String</a>, so I should be able to use it as a String, not an object...</p>
  
  <p>Any idea ?</p>