JSFiddle - React, Tailwind, and code Playground
JavaScript
// удалить один символ
S1 = "abcdef";
L = S1.length;
N = Math.floor(Math.random() * L);
S2 = S1.slice(0, N) + '_' + S1.slice(N+1,L);
alert('длина текста ' + L + ', удалить символ ' + N + ' -> ' + S2);