I'm not really understanding what you want...
you have a string off words... between the words are spaces and you want to add spaces?
couldn't you just do something like:
code:
String s="the string";
int i=0;
while(i>-1&&i<s.length){
i=s.IndexOf(" ",i);
String temp1 = s.substring(0,i);
String temp2 = s.substring(i,s.length);
temp1 +=" ";
s= temp1+temp2
}
or something like that?