Skip to main content

AlphaIndexExt

Trait AlphaIndexExt 

Source
pub trait AlphaIndexExt {
    // Required method
    fn to_alpha(self) -> char;
}
Expand description

0..26 の添字を小文字の ASCII 英字へ変換します。

usize と u8 に実装されています。26 以上の値を渡すと panic します。

§Examples

use atcoder::string::AlphaIndexExt;

assert_eq!(0_usize.to_alpha(), 'a');
assert_eq!(25_u8.to_alpha(), 'z');

Required Methods§

Source

fn to_alpha(self) -> char

小文字 ASCII 英字に対応する添字を返します。

0 は a、25 は z です。self が 26 以上の場合は panic します。

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AlphaIndexExt for u8

Source§

impl AlphaIndexExt for usize

Implementors§