Contact: aviboots(AT)netvision.net.il
39,987 questions
51,931 answers
573 users
let str = "abc123def"; const mid = Math.floor(str.length / 2); const N = 3; str = str.substring(0, mid - Math.floor(N / 2)) + str.substring(mid + 1 + Math.floor(N / 2)); console.log(str); /* run: abcdef */