API Reference › Path › Path.stem
method

Path.stem

Path.stem(p) -> string

Returns the final component with its extension removed — the "stem". Useful for deriving an id or a sibling filename. stem("mods/foo/data.json") is "data".

Parameters

pthe path

Example

program Stem {
  entry {
    if Path.stem("data.json") == "data" { print(1) }
  }
}
← All symbols