fileStem method

Option<String> fileStem()

Extracts the portion of the file name before the last "." -

None, if there is no file name; The entire file name if there is no embedded .; The entire file name if the file name begins with . and has no other .s within; Otherwise, the portion of the file name before the final .

Implementation

Option<String> fileStem() {
  final fileStem = _posix.basenameWithoutExtension(string);
  if (fileStem.isEmpty) {
    return None;
  }
  return Some(fileStem);
}