txtfmt

Crates.iotxtfmt
lib.rstxtfmt
version0.1.2
created_at2025-03-19 05:12:50.632289+00
updated_at2025-03-19 05:15:40.600451+00
descriptiontxtfmt
homepagehttps://github.com/i18n-site/rust/tree/dev/txtfmt
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1597707
size19,879
i18n.site (i18nsite)

documentation

README

txtfmt

pub fn txtfmt(txt: impl AsRef<str>) -> String {
  txt.as_ref()
    .trim_end()
    // 把 \r\n 和 \r 都变为 \n
    .lines()
    .map(|l| l.trim_end())
    .collect::<Vec<_>>()
    .join("\n")
}

About

This project is an open-source component of i18n.site ⋅ Internationalization Solution.

关于

本项目为 i18n.site ⋅ 国际化解决方案 的开源组件。

Commit count: 68

cargo fmt