I'm trying to split a string in power-shell... I've already done some work on the string, but i can't figure out this last part.
Say I'm sitting with this string:
This is a string. Its a comment that's anywhere from 5 to 250 characters wide.
I want to split it at the 30 character mark, but I don't want to split a word. If I was to split it, it would have "... commen" on one line... "t that..." on the next line.
What's a graceful way of splitting the string, 50max, without breaking a word in half? Say for simplicity sake a word is a space (comments might have numeric text "$1.00" in it as well. Don't want to split that in half either).