Link to home
Start Free TrialLog in
Avatar of josgood
josgoodFlag for United States of America

asked on

AllowHexSpecifier doesn't parse "x1"

I'd like to parse
      int a = Int32.Parse("x1",System.Globalization.NumberStyles.AllowHexSpecifier);
but it throws FormatException "Input string was not in a correct format."

What should I be doing?
Avatar of rachitkohli
rachitkohli
Flag of India image

If you want to specify hex specified, its &H
example CLng("&H12")

Else in case of your function it should be just 1 & not x1
What about this:
"0x1"
ASKER CERTIFIED SOLUTION
Avatar of josgood
josgood
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial