Function readformat::readf

source ·
pub fn readf(format: &str, s: &str) -> Option<Vec<String>>
Expand description

The inverse of format!(). The format argument is the format string, and the s argument is the string to match the format against.

Examples:

  • readf("Hello, {}!", "Hello, world!") => Some(vec!["world"])
  • readf("I hope {} are {}!", "I hope you are doing well!") => Some(vec!["you", "well"])
  • readf("Goodbye, {}!", "Hello, world!") => None