trim the leading forward-slashes at the beginning of a string.
import { assertEquals } from "jsr:@std/assert"// aliasing our functions for brevityconst eq = assertEquals, fn = trimStartSlasheseq(fn("///a/b.txt//"), "a/b.txt//")eq(fn("/.//a/b.txt//"), ".//a/b.txt//")eq(fn(".///../a/b.txt//"), ".///../a/b.txt//")eq(fn("file:///a/b.txt//"), "file:///a/b.txt//") Copy
import { assertEquals } from "jsr:@std/assert"// aliasing our functions for brevityconst eq = assertEquals, fn = trimStartSlasheseq(fn("///a/b.txt//"), "a/b.txt//")eq(fn("/.//a/b.txt//"), ".//a/b.txt//")eq(fn(".///../a/b.txt//"), ".///../a/b.txt//")eq(fn("file:///a/b.txt//"), "file:///a/b.txt//")
trim the leading forward-slashes at the beginning of a string.
Example