---
title: "New lines are more than \\r and \\n"
url: https://daily.dev/posts/new-lines-are-more-than-r-and-n-r3trz86lv
source_url: https://www.meziantou.net/new-lines-are-more-than-r-and-n.htm
type: article
source: "Meziantou"
published: 2026-06-15T14:10:37.380Z
updated: 2026-06-15T14:11:00.055Z
tags: [".net", "c#"]
reading_time: 4
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# New lines are more than \r and \n

**[Meziantou](https://daily.dev/sources/meziantou)** · 4 min read · 0 upvotes · 0 comments

## Summary

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.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.meziantou.net/new-lines-are-more-than-r-and-n.htm>

## Similar posts on daily.dev

- [Breaking up \(lines\) is hard to do](https://daily.dev/posts/breaking-up-lines-is-hard-to-do-lxmi6sszj) · Planet Python · 0 upvotes · 0 comments
- [TIL: Python's splitlines does a lot more than just newlines](https://daily.dev/posts/til-python-s-splitlines-does-a-lot-more-than-just-newlines-inmbseyhe) · Lobsters · 2 upvotes · 0 comments
- [C\# Multiline Strings: Verbatim Literals, Raw String Literals, and UTF-8 Literals](https://daily.dev/posts/c-multiline-strings-verbatim-literals-raw-string-literals-and-utf-8-literals-88yr4getw) · We Are .NET · 9 upvotes · 1 comments

---

Tags: [#.net](https://daily.dev/tags/.net), [#c#](https://daily.dev/tags/c#)

[View this post on daily.dev](https://daily.dev/posts/new-lines-are-more-than-r-and-n-r3trz86lv)
