Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

C# conversion byte arrays

Status
Not open for further replies.

bont

Programmer
Sep 7, 2000
200
US
I have C# code as such:

Code:
if ((attributeValue[i] < '\x20') && (attributeValue[i] != '\t') && (attributeValue[i] != '\n') && (attributeValue[i] != '\r'))
				{

I am trying to convert it and much like it to vb.net

I currently have this
Code:
If (Asc(attributeValue(i)) < 20 And (attributeValue(i) <> vbTab) And (attributeValue(i) <> vbNewLine) And (attributeValue(i) <> vbCr)) Then

I seem to be having a problem with the first condition. How do I make the equivalent of:

Code:
attributeValue[i] < '\x20'

in VB.NET
 
I believe that in C#, the "\x" stands for hexadecimal, so you would need to change the code snippet to :

Code:
If (Asc(attributeValue(i)) < 32 And (attributeValue(i) <> vbTab) And (attributeValue(i) <> vbNewLine) And (attributeValue(i) <> vbCr)) Then

--Rob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top