TextFieldParser相当于.NET? [英] TextFieldParser equivalent in .NET?

查看:151
本文介绍了TextFieldParser相当于.NET?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个(现代)等的.NET VB6的类 TextFieldParser ?因为在性能上比简单的低了不少字符串.Split()

There is an (modern) equivalent .NET Class of the VB6 TextFieldParser?, because in performance that is a lot lower than a simple String.Split()

推荐答案

我努力的表现与code比较:的https: //gist.github.com/Ruszrok/7861319

I try performance compare with that code: https://gist.github.com/Ruszrok/7861319

我使用了大约100万条记录用空格分隔输入文件。 Itryed五个实验。

I used input file about 1 000 000 records separated with spaces. Itryed five experiments.

  • String.Split平均时间: 291毫秒
  • Microsoft.VisualBasic.FileIO.TextFieldParser平均时间: 15843毫秒
  • String.Split avg time: 291 ms
  • Microsoft.VisualBasic.FileIO.TextFieldParser avg time: 15843 ms

您可以使用 Microsoft.VisualBasic.FileIO.TextFieldParser 类。参考 Microsoft.VisualBasic程序。样品的要点。

You can use the Microsoft.VisualBasic.FileIO.TextFieldParser class. Reference Microsoft.VisualBasic. Sample in gist.

这篇关于TextFieldParser相当于.NET?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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