小编use*_*123的帖子

Surround every word with double quotes

I have to write function in C# which will surround every word with double quotes. I want it to look like this:

"Its" "Suposed" "To" "Be" "Like" "This"
Run Code Online (Sandbox Code Playgroud)

Here is the code I've come up with so far, but its not working:

protected void btnSend_Click(object sender, EventArgs e)
{
    string[] words = txtText.Text.Split(' ');
    foreach (string word in words)
    {
        string test = word.Replace(word, '"' + word + '"');

    }
    lblText.Text = words.ToString();
}
Run Code Online (Sandbox Code Playgroud)

.net c# string

4
推荐指数
1
解决办法
1906
查看次数

标签 统计

.net ×1

c# ×1

string ×1