编写一个控制台应用程序,给字符串中的每一个单词加上双引号.

来源:互联网 发布:桌面便签软件 知乎 编辑:程序博客网 时间:2024/06/05 15:22
using System;using System.Collections.Generic;using System.Linq;using System.Text;namespace _5_5_7{    class Program    {        static void Main(string[] args)        {            string str = "OK this right";            string  [] strArray;            strArray = str.Split(); //字符串转换为字符串数组            for (int i = 0; i < strArray.Length; i++)            {                strArray[i] = "\""+strArray[i]+"\"";            }            foreach (string display in strArray)            {                Console.WriteLine(display);            }        }    }}

 

 

 

 

 


 

原创粉丝点击