【发布时间】:2014-02-18 11:44:24
【问题描述】:
我有一个字符串,其中包含很多文本,其中有像..这样的子字符串
1 . 1 To Airtel Mobile
1 03/MAR/2013 16:06:31 9845070641 05:44 1.80 **
2 04/MAR/2013 10:00:29 9845096416 00:14 0.30 **
3 04/MAR/2013 20:02:35 9845096416 08:12 2.70 **
4 06/MAR/2013 21:20:03 9632176702 00:37 0.30 **
5 09/MAR/2013 11:40:45 9845444042 01:29 0.60 **
6 11/MAR/2013 18:59:08 9900054971 01:14 0.60 **
7 12/MAR/2013 13:43:01 9686568009 03:57 1.20 **
8 13/MAR/2013 17:38:18 7760995045 00:48 0.30 **
9 21/MAR/2013 09:26:20 9845444043 02:47 0.90 **
10 21/MAR/2013 11:02:39 9845444043 00:15 0.30 **
11 22/MAR/2013 18:00:00 9845096416 00:11 0.30 **
Total 25:28 9.30
现在,根据我的要求,我必须将这个子字符串“1 . 1 To Airtel Mobile”之后的行读取到这个子字符串“Total 25:28 9.30”。这是我在 c# 中的代码,它将检查“1 . 1 To Airtel Mobile”出现在字符串中。现在根据我的要求如何读取指定子字符串的行,即“Total 25:28 9.30”。 这是我在 C# 中的代码..
if(currentText.Contains("1 . 1 To Airtel Mobile"))
{
using (StringReader reader = new StringReader(currentText))
{
//
}
【问题讨论】:
-
你正在从文件中读取文本吗?
-
@SergeyBerezovskiy 是的,它是 PDF 文件,我正在使用 itext 逐页阅读