c# - How do I remove empty space using Regex? -


i have object value save sql database. when run report on sql database, display   in report. tried cleaning properties in objects before saving them sql using following regex:

regex rgx = new regex("[^a-za-z0-9 - , = % & ( )]"); myobject.description = rgx.replace(myobject.description, ""); 

the regular expression doing job removing unwanted text. how use regular expression remove   ?

just add string original regex delimited |

regex rgx = new regex(@"[^a-za-z0-9-,=%&()#\s]| "); 

Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -