从文本替换连字符撇号等字符 [英] Replace characters like hyphen apostrophe from text

查看:113
本文介绍了从文本替换连字符撇号等字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我从一个文本文件中读取数据.文本文件包含连字符(-)撇号('')之类的字符.我想从整个文本文件中替换这些字符,然后阅读/显示给用户.

在asp.net vb中对上述问题的任何帮助将不胜感激.

谢谢!

Hi,

I read data from a text file. The text file contains characters like hyphen (-) apostrophe (''). I want to replace these characters from the entire text file and then read it/show it to user.

Any help with the above issue in asp.net vb would be appreciated.

thanks!

推荐答案

使用替换"功能
use the Replace function
string text = "hello! this-is-text";
string myText = text.Replace("-", " ");

// will return "hello! this is text"



VB.NET中的初学者教程 http://www.dotnetperls.com/replace-vbnet [



A beginners tutorial in VB.NET http://www.dotnetperls.com/replace-vbnet[^]


这篇关于从文本替换连字符撇号等字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆