getFileNameWithoutExtension static method

String getFileNameWithoutExtension(
  1. String filePath
)

Get file name without extension from file path

filePath - The file path Returns file name without extension

Implementation

static String getFileNameWithoutExtension(String filePath) {
  final fileName = getFileName(filePath);
  final lastDot = fileName.lastIndexOf('.');
  if (lastDot == -1) return fileName;
  return fileName.substring(0, lastDot);
}