分割文字 [英] Splitting a text

查看:58
本文介绍了分割文字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨 我正在尝试为我的应用程序创建一个简单的搜索引擎.我需要拆分用户编写的文本.重要的一点是字符.例如,当输入文本是:编程代码项目" 时,结果字符串必须是:编程代码项目.这意味着两个字符"之间的字符串不应分开.请指导我.感谢

Hi I''m trying to make a simple search engine for my application. I need to split the text that has been wrote by user. The important point is the " char. for example when the input text is: programming "Code Project" , the result strings must be : programming and Code Project. it means that the string between two " characters shouldn''t be separated. please guide me. Thanks

推荐答案

您可以看一下这篇文章.它提供了一个用于执行此操作的类.

持久性字符串解析器 [
You could look at this article. It provides a class for doing just that.

Persistent String Parser[^]


尝试使用string.Split()方法.
例如
Try using the string.Split() method.
Eg.
string temp = @"programming""Codeproject";
string [] Res = new string[10];
Res = temp.Split(''"'');


这篇关于分割文字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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