Function chomp::ascii::string_ci
[−]
[src]
pub fn string_ci<I: Input<Token = u8>>(
i: I,
s: &'static [u8]
) -> SimpleResult<I, I::Buffer>
Matches the given slice against the parser in a case-insensitive manner, returning the matched slice upon success. Only respects ASCII characters for the case-insensitive comparison.
If the length of the contained data is shorter than the given slice this parser is considered incomplete.
use chomp::prelude::parse_only; use chomp::ascii::string_ci; assert_eq!(parse_only(|i| string_ci(i, b"abc"), b"abcdef"), Ok(&b"abc"[..])); assert_eq!(parse_only(|i| string_ci(i, b"abc"), b"aBCdef"), Ok(&b"aBC"[..]));