| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 591 人关注过本帖
标题: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
快速回复:newbie's question
数据加载中...
 
   



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

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