Absolutely John. Unfortunately, acedemic and philosophical niceties can
often loose sight of common sense.
The String methods .Substring and .Trim will achieve what you want with
perfectly understandable code.
You might like to browse for a thread, a few days ago, regarding this
subject where some tests showed that the Microsoft.VisualBasic.Mid and
Microsoft.VisualBasic.Trim functions can be more efficient than the
String.Substring and String.Trim methods.
"John B" <Jo***@discussions.microsoft.com> wrote in message
news:52**********************************@microsof t.com...
Seems like a lot of work when I can just put a dozen substrings and get
the
same result. Seems like all this is a step backwards. In the "olden
days"
you could map into a buffer and access the data.
"steve" wrote:
google much? ;^)
too many examples to choose from...here's one from the code project.
http://www.codeproject.com/info/erro...FileParser.asp
"John B" <Jo***@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
| I'm receiving a fixed length string with fixed length fields that I
need
to
| break apart. Ideally I'd like to take the string and put it into a
Structure
| and then access the individual fields from there.
|
| I tried converting the string to a byte array and then used a
| Marshal.PtrToStructure to do the move but get a null reference
exception
in
| mscorlib.dll. All the paramers look valid going into the call.
|
| Any ideas how to fix the error or is there another way to do this?
|