withoutExtension property

String get withoutExtension

返回排除后缀名称

Implementation

String get withoutExtension {
  if (this == null) {
    return "";
  }
  int endIndex = this?.lastIndexOf(".") ?? 0;
  if (endIndex < 0) {
    return this ?? "";
  }
  return this?.substring(0, endIndex) ?? "";
}