Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Indexing_fmt: A helper crate to format super¹²³ and sub₈₄₀ scripts
use indexing_fmt::*;
let index = 12;
let name = format!("Ship{}", index.to_superscript());
assert_eq!(name, "Ship¹²");
let index = 840;
let name = format!("Docking-Bay{}", index.to_subscript());
assert_eq!(name, "Docking-Bay₈₄₀");
3 posts - 2 participants
🏷️ rust_feed