Skip to main content

extension_from_name

Function extension_from_name 

Source
pub fn extension_from_name(name: &str) -> Option<String>
Expand description

Extracts the lowercase final extension from a file name.

Only ASCII-alphanumeric candidates count as extensions; path-like input ("dir.ext/file") or names whose suffix contains spaces/punctuation return None, because the extracted value can be persisted and shown in UIs.