Most developers only handle \r\n and \n as line endings, but Unicode defines additional newline characters including NEL (\u0085), Line Separator (\u2028), Paragraph Separator (\u2029), Vertical Tab (\v), and Form Feed (\f). These can appear in user input, office-copied text, or cross-platform data and cause silent parsing bugs. In .NET, safer line splitting can be done with a Regex pattern covering all Unicode newlines, or using Regex.EnumerateSplits (allocation-free, .NET 9+). The built-in string.ReplaceLineEndings normalizes all variants to a single convention. TextReader.ReadLine() only handles the three classic terminators and may not be sufficient for all scenarios.
Table of contents
# The line breaks you should know# Why this matters in real code# Safer parsing in .NET# Additional resources534 Impressions