htm_tag

Crates.iohtm_tag
lib.rshtm_tag
version0.1.2
created_at2025-08-06 02:36:34.293059+00
updated_at2025-08-06 02:37:53.449444+00
descriptionhtm_tag
homepagehttps://github.com/i18n-site/rust/tree/dev/htm_tag
repositoryhttps://github.com/i18n-site/rust.git
max_upload_size
id1783323
size21,503
i18n.site (i18nsite)

documentation

README

htm_tag

pub fn htm_tag(s: &str) -> Option<&str> {
  let mut iter = s.char_indices();
  if let Some((pos, c)) = iter.next()
    && c.is_ascii_alphabetic()
  {
    let begin = pos;
    let mut end = s.len();
    for (pos, c) in iter {
      if !c.is_alphanumeric() {
        end = pos;
        break;
      }
    }
    return Some(&s[begin..end]);
  }
  None
}

About

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

关于

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

Commit count: 68

cargo fmt