For those of you who don't have your own personal @Catfish_Man to answer your questions (you really should; it's quite the time saver, but get your own):
Interesting fact I learned today. In Swift, "\r\n" is one Character because that's what Unicode requires. https://unicode.org/reports/tr29/#GB3
So str.split("\n") may not do what you expect if \r\n is present. \r\n is one Character, which is not equal to \n, so it won't split at all. (I expected it to split, and leave the \r, but Unicode says no).
@cocoaphony @Catfish_Man Oh yeah, that's a great consequence of how Swift handles strings. No need to fiddle with new-line sequences, as they are just characters. However, to split, always use Character.isNewLine. It detects all sorts of new line things, including the ones you didn't know existed. https://developer.apple.com/documentation/swift/character/isnewline