Tue Nov 19 2024 14:09:25 GMT+0000 (Coordinated Universal Time)
Saved by @esmeecodes
export function removeChar(str: string): string { let newString = str.split(""); newString = newString.slice(1,-1); return newString.join(""); } // Another better option: export function removeChar(str: string): string { return str.slice(1,-1); }
Slice / Split
Copy this HTML code:
Preview:
open_in_newInstructions on embedding in Medium
Comments