专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »DotNet » 去掉字符串空格:C#如何去掉字符串中所有空格 »正文

去掉字符串空格:C#如何去掉字符串中所有空格

来源: 发布时间:星期五, 2009年1月9日 浏览:70次 评论:0
  由于空格ASCII码值是32因此在去掉串中所有空格时只需循环访问串中所有并判断它们ASCII码值是不是32即可去掉串中所有空格关键代码如下: CharEnumeratorCEnumerator=textBox1.Text.GetEnumerator;
while(CEnumerator.MoveNext)
{
  .gif' />=[1];
  .gif' />=.Text.Encoding.ASCII.GetBytes(CEnumerator.Current.);
  asciicode=()(.gif' />[0]);
  (asciicode!=32)
  {
    textBox2.TextCEnumerator.Current.;
  }
}


0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: