dotnet / dotnet/dotnet-api-docs

IsNumeric Exception

Open
#1,661 0 comments 0 reactions 0 assignees View on GitHub
area-Microsoft.VisualBasic dotnet-api/prod Pri2 untriaged
Dominant language
C#
Stars
949
Forks
1.7k
Avg merge
3d 27m
Merged PRs (30d)
49

Description

In VB.Net we are using IsNumeric to prevent an exception but when we pass "&h-#" I get System.ArgumentException with message "String cannot contain a minus sign if the base is not 10."

&h-# is a randomly generated value, but we didn't expect IsNumeric to throw an exception, just return False

Ex:
Dim isNumber As Boolean = IsNumeric("&h-#")

---
#### Document Details

⚠ *Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.*

* ID: 1fc35bdd-823b-c1b8-d867-dcfeeb3de382
* Version Independent ID: aa00be7d-5ae9-2e18-8281-7762fbb26009
* Content: [Information.IsNumeric(Object) Method (Microsoft.VisualBasic)](https://docs.microsoft.com/en-us/dotnet/api/microsoft.visualbasic.information.isnumeric?view=netframework-4.7.2)
* Content Source: [xml/Microsoft.VisualBasic/Information.xml](https://github.com/dotnet/dotnet-api-docs/blob/master/xml/Microsoft.VisualBasic/Information.xml)
* Product: **dotnet-api**
* GitHub Login: @KathleenDollard
* Microsoft Alias: **kdollard**

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.