returns the substring before the specified expression
None
If the specified expression is found within the string the substring before the expression is returned. Otherwise the string is returned unaltered.
If nth is specified then the nth occurence of the expression expr is looked for. If there are not at least n matches for expr within str then the string is returned unaltered.
A very similar function is std_types::string/std::before. It behaves differently only when the expression is not found.
std::truncate_from | returns the substring before the specified expression |
std_types::string/std::before | returns the substring before the specified expression |
std_types::string/std::behind | returns the substring after the specified expression |
std_types::string/std::between | returns the substring between two expressions |
std_types::string/std::until | returns the substring until (including) the specified expression |