Вы можете использовать это.Хотя я думаю, что решение @LukeH лучше, если у вас нет других пробелов, которые вы хотите оставить нетронутыми.
resultString = Regex.Replace(subjectString, @"(\b\w+\b)(?!$)", "$1 ");
Объяснение:
"
( # Match the regular expression below and capture its match into backreference number 1
\b # Assert position at a word boundary
\w # Match a single character that is a “word character” (letters, digits, etc.)
+ # Between one and unlimited times, as many times as possible, giving back as needed (greedy)
\b # Assert position at a word boundary
)
(?! # Assert that it is impossible to match the regex below starting at this position (negative lookahead)
$ # Assert position at the end of the string (or before the line break at the end of the string, if any)
)
"