str_len0!() { /* proc-macro */ }
Expand description
Procedural macro proc_strarray::str_len0!
returns length of
zero terminated str or byte str literal.
§See also
str_len!
: returns length of str literal.
§Example
// This code will create const usize and assign length of supplied string to it.
use proc_strarray::str_len0;
const PMD85: usize = str_len0!("PMD-85");
assert_eq!(PMD85, 7);
const IQ151: usize = str_len0!(b"IQ-151");
assert_eq!(IQ151, 6+1);