标题:newbie's question
只看楼主
Darwin
Rank: 1
等 级:新手上路
帖 子:10
专家分:0
注 册:2008-7-17
 问题点数:0 回复次数:1 
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();
    }
搜索更多相关主题的帖子: question newbie 
2008-07-30 05:50
xyq701830
Rank: 1
来 自:浙江
等 级:新手上路
威 望:2
帖 子:263
专家分:0
注 册:2008-6-24
得分:0 
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?
什么意思啊,不理解啊

菜猪猪``
2008-07-30 08:37



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-225852-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.633935 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved