Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
It can be possible to add single space after every word in a file?
e.g.
HI     HOW R U?
I'mFine

I Want the result as follow:-
HI HOW R U?
I'm Fine.
Posted
Comments
Sergey Alexandrovich Kryukov 12-Mar-15 1:25am    
Your sample does something opposite to "adding" :-)
—SA
Member 11466475 12-Mar-15 1:27am    
Thnx for the help..
But it work for only for replace multiple sapce into single space..
The result come as follow:-
HI HOW R U?
I'mFine
--------------
but I'mFine is concated...
How add space in betweeb that I'm Fine.

1 solution

Using RegEx
C#
var t = new Regex(@"\s\s+");
var output = t.Replace(myStr, " ");
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900