Skip to main content

match_string

Function match_string 

Source
pub fn match_string(s1: &str, s2: &str) -> f64
Expand description

Returns a similarity score between two strings using a fuzzy matching algorithm.

§Examples

use handy::pattern::match_string;

let s1 = "Salvage Yard";
let s2 = "yard";

let score = match_string(s1, s2);
println!("Score: {}", score);

§Arguments

  • s1 - The first string.
  • s2 - The second string.

§Returns

The similarity score between the two strings.