With regex
"The quick brown fox jumps over the lazy dogs.".replace(/(.{5})/g,"$1$")
The q$uick $brown$ fox $jumps$ over$ the $lazy $dogs.$
With regex
"The quick brown fox jumps over the lazy dogs.".replace(/(.{5})/g,"$1$")
The q$uick $brown$ fox $jumps$ over$ the $lazy $dogs.$