title: Swift: Split string into array at new line - Windows-based text
body: <p>I am splitting a string into array at new line. The text comes from a server and can be created on multiple platforms. Have no issues with Unix text, however because of the new line definition issues (\n\r vs \n), the text is not split if it is sent from Windows-based server.</p>
  
  <p>I am using this to find a regex expression for a new line and replace it with \n:</p>
  
  <pre><code>let stringRev = self.string.stringByReplacingOccurrencesOfString( "(\r\n|\r|\n)", withString: "\n", options: NSStringCompareOptions.RegularExpressionSearch, range: nil)
  
  let myArray = stringRev.componentsSeparatedByString("\n")
  </code></pre>
  
  <p>Is there a way to do it in Swift?</p>
  
  <p>Many thanks!</p>