Skip to main content

normalize

Function normalize 

Source
pub fn normalize(text: &str, to: Newline) -> String
Expand description

Replace every line ending in text with to.

use detect_newline::{normalize, Newline};
assert_eq!(normalize("a\r\nb\rc", Newline::Lf), "a\nb\nc");