I have a string: "The quick brown fox jumps over the lazy dogs."
I want to use javascript (possibly with jQuery) to insert a character every n characters. For example I want to call:
var s = "The quick brown fox jumps over the lazy dogs.";
var new_s = UpdateString("$",5);
// new_s should equal "The q$uick $brown$ fox $jumps$ over$ the $lazy $dogs.$"
The goal is to use this function to insert &shy into long strings to allow them to wrap. Maybe someone knows of a better way?