pub fn get_file_extension(filename: &str) -> &strExpand description
Get file extension from filename. Returns the extension without the dot, or empty string if no extension.
ยงExamples
use chie_shared::get_file_extension;
// Extract extensions
assert_eq!(get_file_extension("document.pdf"), "pdf");
assert_eq!(get_file_extension("video.mp4"), "mp4");
assert_eq!(get_file_extension("archive.tar.gz"), "gz"); // Gets last extension
// Files without extensions
assert_eq!(get_file_extension("README"), "");
assert_eq!(get_file_extension("noextension"), "");
// Hidden files
assert_eq!(get_file_extension(".gitignore"), "gitignore");