Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
I have string str="Arts And Props"
now i want to replace space in string with null.
means i want result as str="ArtsAndProps"
Posted
Comments
Sandeep Mewara 5-May-10 2:59am    
You just want to remove 'spaces' and not insert NULL!

Try str.Replace(" ",string.Empty);
 
Share this answer
 
No, you're wrong. You want to replace the string with an empty string. Null is something different. The string class has a Replace method, replace " " with string.Empty and you're done.
 
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