How to include whitespace in C# code
I am making application, in which i have lot of column in sql but in one column i want to store data using whitespace like my data is "what is variable and when we declare variable" but in database it should be store "what_is_variable_and_when_we_declare_variable". in this manner. what is the code in C# to include "underscore _" in program.
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Kunal VaishyaRank #990 · 2K reputationPosted May 2, 2012, 10:46 PM EDT
use this string like this
const string s = "what is variable and when we declare variable";
string v = s.Replace(" ", "_");
at the fetching time use like this
const string s = "what_is_variable_and_when_we_declare_variable";
string v = s.Replace("_", ",");