Macro const_str::len[][src]

macro_rules! len {
    ($s : expr) => { ... };
}
Expand description

Returns the length of a string slice or a byte string

Examples

const S: &str = "hello";
const B: &[u8; 6] = b"hello\0";
assert_eq!(const_str::len!(S), 5_usize);
assert_eq!(const_str::len!(B), 6_usize);