pub fn as_str(&self) -> Option<&str> {
        match *self {
            Self::String(ref s) => Some(s),
            _ => None,
        }
    }
/// Returns the value as a string slice if it is a string slice.
///
/// # Examples
///
/// ```
/// use noodles_sam::record::data::field::Value;
/// assert_eq!(Value::String(String::from("noodles")).as_str(), Some("noodles"));
/// assert_eq!(Value::Int(0).as_str(), None);
/// ```
Returns the value as a string slice if it is a string slice.
Returns the value as a string slice if it is a string slice .
pub fn as_str(&self) -> Option<&str> {
        match *self {
            Self::String(ref s) => Some(s),
            _ => None,
        }
    }
pub fn as_str ( & self ) -> Option < & str > { match * self { Self :: String ( ref s ) => Some ( s ) , _ => None , } }
Returns the value as a string slice if it is a string slice.
Returns the value as a string slice if it is a string slice .
&self
&self
examples
```
use noodles_sam::record::data::field::Value;
assert_eq!(Value::String(String::from("noodles")).as_str(), Some("noodles"));
assert_eq!(Value::Int(0).as_str(), None);
```
` ` ` use noodles_sam :: record :: data :: field :: Value ; assert_eq! ( Value :: String ( String :: from ( " noodles " )) . as_str () Some ( " noodles " )) ; assert_eq! ( Value :: Int ( 0 ) . as_str () None ) ; ` ` `