HasSuffix

Function HasSuffix 

Source
pub fn HasSuffix(s: impl AsRef<[byte]>, suffix: impl AsRef<[byte]>) -> bool
Expand description

HasSuffix tests whether the byte slice s ends with suffix.

zh-cn 判断s是否有后缀切片suffix。

§Example

use gostd_bytes as bytes;

assert_eq!(true,bytes::HasSuffix("Amirust","rust"));
assert_eq!(false,bytes::HasSuffix("Amirust","R"));
assert_eq!(false,bytes::HasSuffix("Amirust","Ami"));
assert_eq!(true,bytes::HasSuffix("Amirust",""));