Open this example in the interactive library
Source code
import { Buffer } from "node:buffer";
console.log(Buffer.from("a/b/c").lastIndexOf("/"));
Sample output
3

Open this example in the interactive library
import { Buffer } from "node:buffer";
console.log(Buffer.from("a/b/c").lastIndexOf("/"));
3