Link to home
Start Free TrialLog in
Avatar of ksd123
ksd123

asked on

Remove all spaces in c#

Hi Experts,

I have below mapping class and from client side will get registrationnumber data in the form of  123 456 7899 and should trim all the spaces (1234567899) and save it to database.what is best way to achieve this?

public class UserMapp
{

public void Map(user userobj, customer custobj)
{

userobj.registrationnumber=custobj.registrationnumber; 

}

}

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Member_2_99151
Member_2_99151

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AndyAinscow
In addition - don't forget that is throwing information away which you can not restore unless the format is always (not 999,999 from a million times) the same.

I've experienced similar, this happens always and then later very occasionally it is different, how do we restore it to the original format.  Ooops!!!!!
Avatar of ksd123
ksd123

ASKER

Thank  you all