A new answer, since you've changed your question:
This is a very simplistic PHP solution:
<?php
$string = "AnExtremelyLongStringWithoutWhitespacesOrBreakpointsOfAnyKindThatWillCompletelyAndUtterlyRuinYourWebsiteDesign";
for($i=0; $i<strlen($string); $i++) {
$newString .= $string[$i] . '­';
}
echo $newString;
The same can be achieved in any language ofcourse.