Is there a modern .NET equivalent to the TextFieldParser
class in VB6? Performance is a lot lower than a simple String.Split()
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
I have compared performance with that code: https://gist.github.com/Ruszrok/7861319
I used an input file with about 1 000 000 records separated with spaces. I tried five experiments.
String.Split
avg time: 291 msMicrosoft.VisualBasic.FileIO.TextFieldParser
avg time: 15843 msYou can use the
Microsoft.VisualBasic.FileIO.TextFieldParser
class. ReferenceMicrosoft.VisualBasic
. Sample in gist.This is my solution:
A simple session: