isOfficeFile static method

bool isOfficeFile(
  1. String filename
)

Checks if the given filename corresponds to an office file.

Parameters:

  • filename: The name of the file to check.

Returns:

  • A boolean indicating whether the file is an office file.

Implementation

static bool isOfficeFile(String filename) {
  return filename.endsWith(".doc") ||
      filename.endsWith(".docx") ||
      filename.endsWith(".xls") ||
      filename.endsWith(".xlsx") ||
      filename.endsWith(".ppt") ||
      filename.endsWith(".pptx");
}