本文介绍了如何从一条线上取出一个特定的句子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,



我有一个包含这样的行的文件...



 app_title_data =  这是应用程序的标题 
app_subtitle_data = 这是副标题
;评论在这里
app_content = 内容在这里





我可以使用文件阅读器检索整行...

我想在特定关键字的双引号内获取字符串, ,

但是我不想为每个字符循环,,,因为文件可能非常大...

现在我使用此代码来分割关键字和价值......



  string  [] str = line.Trim ()。Split( new   string  [] {  =},StringSplitOptions.None); 





Any建议??

解决方案



Hi friends,

I have a file that contains lines like this ...

app_title_data = "This is the title of the application"
app_subtitle_data = "This is the subtitle"
; Comment goes here
app_content ="Content goes here"



I could retrieve the entire line using file reader...
I want to get the string inside double quotes for the specific keyword,,,
But I dont want to loop for each character,,, since the file may be very large...
Now I am using this code to split the keyword and value...

string[] str = line.Trim().Split(new string[] { "=" }, StringSplitOptions.None);



Any suggestions ??

解决方案



这篇关于如何从一条线上取出一个特定的句子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 01:13