当前位置: 代码迷 >> 综合 >> 去处字符串两边的空格
  详细解决方案

去处字符串两边的空格

热度:7   发布时间:2024-01-17 03:39:19.0
using System;namespace ConsoleApplication2
{class Program{static void Main(string[] args){string str = " Hel lo ";Console.WriteLine("|{0}|", str);// 去处字符串两边的空格str = str.Trim();Console.WriteLine("|{0}|", str);Console.ReadKey();}}}



  相关解决方案