const trim = (str, char) => str.split(char).filter(Boolean).join();
const trim = (str: string, char: string): string => str.split(char).filter(Boolean).join();
trim('/hello world//', '/'); // hello worldtrim('"hello world"', '"'); // hello worldtrim(' hello world ', ' '); // hello world