String Wizard Needed!

Is anyone smart enough to make a code that will take a string that is to be put into a dynamic textfield, and if the string is longer than 11 character make the textfield start a new line every time it sees a space in the string, unless the space is followed by ony one character?

i believe it will involve a

if(string.length > 11){
for(i=0; i <string.length; i++){[INDENT]if(string.charAt(i) == " " && string.charAt(i+2) != " "){[INDENT][COLOR=Red]**make the textfield start a new line!
also set _y -= 12
break;
**[/COLOR] [/INDENT]}
[/INDENT]}
}

How do i make it start a new line when all these conditions are satisfied? There must be a way!