Quantcast
Channel: Common Language Runtime Internals and Architecture forum
Viewing all articles
Browse latest Browse all 1710

Array.IndexOf to find location of vbCr, vbLF of vbNull

$
0
0

hello,

I am looking for most efficient way to process return string from my test devices.

Some of my devices terminate string with Chr(13), some with Chr(10), and Chr(0) is also possibility.

As of now I handle it with:

 If Array.IndexOf(data, CByte(10)) > 0 Then
            INDEX = Array.IndexOf(data, CByte(10))
           ElseIf Array.IndexOf(data, CByte(13)) > 0 Then
            INDEX = Array.IndexOf(data, CByte(13))
End If

But it seems that should be a better way.

Thanks in advance.



Viewing all articles
Browse latest Browse all 1710

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>