小编reg*_*reg的帖子

C#如何在不使用空格键的情况下在每个字符之间放置空格

输出需要在每个字符之间有空格,所以它应该像'?emanruoysitah W'并不喜欢"emanruoysitahw".我如何使用我已编写的代码执行此操作.感谢您的帮助.

using System;


namespace strings
{
    class Program
    {
        static void Main(string[] args)

        {
           string inString= "What is your name?",outString="";

           foreach(char c in inString)
           {
           outString = c + outString;
           }
          {
          Console.WriteLine("" + outString);
          }

        }
    }
}
Run Code Online (Sandbox Code Playgroud)

c# space character

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

标签 统计

c# ×1

character ×1

space ×1