pub fn nobang(maybe_banged: &str) -> &str
Expand description
Returns the portion of a YAML tag after the exclamation mark, if any.
A YAML tag is denoted by a leading exclamation mark (!
). If the input value is empty, it is considered not to be a tag. If the input value starts with an exclamation mark, it is considered to be a tag but not a bang tag (i.e., !foo
is a tag, but !bar
is not). If the input value does not start with an exclamation mark, it is considered not to be a tag.
ยงExamples
use serde_yml::value::tagged::nobang;
let result = nobang("foo");
assert_eq!("foo", result);
let result = nobang("!bar");
assert_eq!("bar", result);
let result = nobang("");
assert_eq!("", result);