' This prints the string on one line with no spacing at allĬonsole.WriteLine(regWhitespace.Replace(testString, String.Empty))Ĭonsole.WriteLine("Replace all spaces :") "Second line followed by 2 tabs" + vbTab + vbTab + _Ĭonsole.WriteLine("Replace all whitespace :") of 2 - Microsoft Word-Spacing between words - posted in Business Applications: I have been looking for an answer to this question for a few weeks now. And you are done Now your MS Word document will be devoid of. Keeping the lines selected, press Ctrl + L to do left align. Keeping the lines selected, press Ctrl + R to do right align. Press Ctrl + E to center align these lines.
Now you can see the space between text and underline has been adjusted accordingly. Select lines with leading and/or trailing spaces. Go back to the Font dialog box, select Normal in the box of Position and hit OK.
' Use to match all whitespace (note the lowercase s matters)ĭim testString As String = "First Line" + vbCrLf + _ Put a space after the text, and select the whole space. Learn how to get rid of large space between words in Microsoft Word.You can remove excess space between each word by using the function find and replace to r. For that regular expressions are the most flexible approach I've found.īelow is a console application where you can see the difference between replacing just spaces or all whitespace. "Spaces" in the original post could refer to whitespace, and no answer yet shows how to remove ALL whitespace from a string.