Function voca_rs::chop::before_last

source ·
pub fn before_last(subject: &str, search: &str) -> String
Expand description

Returns everything before the last given search.

Arguments

  • subject - The string to extract from.
  • search - The substring to look for.

Example

use voca_rs::*;
chop::after_last("To be, or not to be, that is the question", "be,");
// => "To be, or not to "
chop::after_last("S̃o̊m̋ȩ̈ gḷ̉y̌p̆ẖs a̋řẹ̆̇ hër̵ē̱, but a̋řẹ̆̇ nŏt tẖër̵ē̱", "a̋řẹ̆̇");
// => "S̃o̊m̋ȩ̈ gḷ̉y̌p̆ẖs a̋řẹ̆̇ hër̵ē̱, but "
use voca_rs::Voca;
"To be, or not to be, that is the question"._after_last("be,");
// => "To be, or not to "