pub fn prefix_suffix_prep(string1: &str, string2: &str) -> (usize, usize, usize) {
    let string1_gc = GraphemeClusters::new(string1);
    let string2_gc = GraphemeClusters::new(string2);
    let mut len1 = string1_gc.len(); // this is also the minimum length of the two strings
    let mut len2 = string2_gc.len();

    // suffix common to both strings can be ignored
    while len1 != 0 && string1_gc[len1 - 1] == string2_gc[len2 - 1] {
        len1 -= 1;
        len2 -= 1;
    }

    // prefix common to both strings can be ignored
    let mut start = 0;
    while start != len1 && string1_gc[start] == string2_gc[start] {
        start += 1;
    }

    if start != 0 {
        len2 -= start;
        len1 -= start;
    }

    (len1, len2, start)
}
/// <summary>Calculates starting position and lengths of two strings such that common
/// prefix and suffix substrings are excluded.</summary>
/// <remarks>Expects string1.Length to be less than or equal to string2.Length</remarks>
Calculates starting position and lengths of two strings such that common
prefix and suffix substrings are excluded.
Expects string1.Length to be less than or equal to string2.Length
Calculates starting position and lengths of two strings such that common prefix and suffix substrings are excluded . Expects string1 . Length to be less than or equal to string2 . Length
pub fn prefix_suffix_prep(string1: &str, string2: &str) -> (usize, usize, usize) {
    let string1_gc = GraphemeClusters::new(string1);
    let string2_gc = GraphemeClusters::new(string2);
    let mut len1 = string1_gc.len(); // this is also the minimum length of the two strings
    let mut len2 = string2_gc.len();
    // suffix common to both strings can be ignored
    while len1 != 0 && string1_gc[len1 - 1] == string2_gc[len2 - 1] {
        len1 -= 1;
        len2 -= 1;
    }
    // prefix common to both strings can be ignored
    let mut start = 0;
    while start != len1 && string1_gc[start] == string2_gc[start] {
        start += 1;
    }
    if start != 0 {
        len2 -= start;
        len1 -= start;
    }
    (len1, len2, start)
}
pub fn prefix_suffix_prep ( string1 : & str , string2 : & str ) -> ( usize , usize , usize ) { let string1_gc = GraphemeClusters :: new ( string1 ) ; let string2_gc = GraphemeClusters :: new ( string2 ) ; let mut len1 = string1_gc . len ( ) ; // this is also the minimum length of the two strings let mut len2 = string2_gc . len ( ) ; // suffix common to both strings can be ignored while len1 != 0 && string1_gc [ len1 - 1 ] == string2_gc [ len2 - 1 ] { len1 -= 1 ; len2 -= 1 ; } // prefix common to both strings can be ignored let mut start = 0 ; while start != len1 && string1_gc [ start ] == string2_gc [ start ] { start += 1 ; } if start != 0 { len2 -= start ; len1 -= start ; } ( len1 , len2 , start ) }
<summary>Calculates starting position and lengths of two strings such that common
prefix and suffix substrings are excluded.</summary>
<remarks>Expects string1.Length to be less than or equal to string2.Length</remarks>
<summary > Calculates starting position and lengths of two strings such that common prefix and suffix substrings are excluded . < / summary > <remarks > Expects string1 . Length to be less than or equal to string2 . Length< / remarks >
string1
&str
string2
&str