title: How to check if the next row in the file is empty?
body: <p>I have this piece of code which reads my file line by line :</p>
  
  <pre><code> data = try String(contentsOfFile: localFilePath as String,
                                encoding: NSASCIIStringEncoding)
  
   let myStrings = data.componentsSeparatedByCharactersInSet(NSCharacterSet.newlineCharacterSet())
  
  
   array = myStrings[0].characters.split(){$0 == ","}.flatMap{
          (Int(String.init($0).stringByTrimmingCharactersInSet(NSCharacterSet.whitespaceCharacterSet())))}
  </code></pre>
  
  <p>Here I am reading the first line of the file and converting the numbers in that line into <code>[Int]</code>. </p>
  
  <p>Now I want to check if there are any numbers/letters in the next line of the file, however when i try and do this: <code>myStrings[1]</code> it gives me <code>Index out of range</code> rightfully so because the next line is empty. </p>
  
  <p>My question is, is there a way to check if the next row in the file has any data, without getting this error?</p>