I am have a Windows Form Application project. In which i want to remove white space from string. Anyone can help me.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
ali tuncerPosted May 13, 2016, 4:47 AM
you can use Replace method to replace white space with string.empty, here is an example :
string test = "Mohammed Ashraf";
Console.WriteLine(test.Replace(" ", string.Empty));
Mohammed AshrafPosted May 14, 2016, 1:00 AM
Mohammed AshrafPosted May 13, 2016, 3:14 AM
ali tuncerPosted May 13, 2016, 2:16 AM
use Trim extension method..
http://www.dotnetperls.com/trim