newbie's question
How to add double quotes to each word of given string of words?Below is my code, which could not display what i really need. Any expert who gives help, please?
-------------------------------
static void Main(string[] args)
{
string str = "yes or no";
string str2 = null;
char[] seperator ={ ' ' };
string[] keys = str.Split(seperator);
Console.WriteLine("Before replaceing:");
Console.WriteLine(str);
Console.WriteLine("After replaceing:");
for (int i = 0; i < keys.Length; i++)
{
keys[i].PadLeft (keys[i].Length+1 ,'-');
keys[i].PadRight(keys[i].Length+2 ,'*');
//Console.Write (keys[i]);
}
for (int i = 0; i < keys.Length; i++)
{
str2 += keys[i];
}
Console.WriteLine(str2);
Console.ReadKey();
}