extensionOf method

  1. @deprecated
String extensionOf(
  1. String path
)

Returns the extension of the path. The extension is the part behind the last '.'. If the only '.' is at the top, the result is '' otherwise the the last part with '.'. deprecated: Use extension() from package path

Implementation

@deprecated
String extensionOf(String path) {
  var rc = '';
  final ix = path.lastIndexOf('.');
  final ixSlash = path.lastIndexOf(sep);
  if (ix > 0 && (ixSlash < 0 || ix > ixSlash + 1)) {
    rc = path.substring(ix);
  }
  return rc;
}