Information.IsNumeric(Object) Yöntem
Tanım
Bir Boolean İfadenin sayı olarak değerlendirilemeyeceğini gösteren bir değer döndürür.Returns a Boolean value indicating whether an expression can be evaluated as a number.
public:
static bool IsNumeric(System::Object ^ Expression);
public static bool IsNumeric (object? Expression);
public static bool IsNumeric (object Expression);
static member IsNumeric : obj -> bool
Public Function IsNumeric (Expression As Object) As Boolean
Parametreler
- Expression
- Object
Gereklidir.Required. Object ifadesini.Object expression.
Döndürülenler
Bir Boolean İfadenin sayı olarak değerlendirilemeyeceğini gösteren bir değer döndürür.Returns a Boolean value indicating whether an expression can be evaluated as a number.
Örnekler
Aşağıdaki örnek, IsNumeric bir değişkenin içeriğinin bir sayı olarak değerlendirilemeyeceğini anlamak için işlevini kullanır.The following example uses the IsNumeric function to determine if the contents of a variable can be evaluated as a number.
Dim testVar As Object
Dim numericCheck As Boolean
testVar = "53"
' The following call to IsNumeric returns True.
numericCheck = IsNumeric(testVar)
testVar = "459.95"
' The following call to IsNumeric returns True.
numericCheck = IsNumeric(testVar)
testVar = "45 Help"
' The following call to IsNumeric returns False.
numericCheck = IsNumeric(testVar)
Açıklamalar
IsNumeric veri türünün,,,,,,, True Expression Boolean Byte Decimal Double Integer Long SByte Short , Single ,, UInteger ULong veya UShort olduğunu döndürür.IsNumeric returns True if the data type of Expression is Boolean, Byte, Decimal, Double, Integer, Long, SByte, Short, Single, UInteger, ULong, or UShort. Ayrıca,, True Expression Char String , veya bir Object sayıya başarıyla dönüştürülebileceğinden, döndürür.It also returns True if Expression is a Char, String, or Object that can be successfully converted to a number. Expression sayısal olmayan karakterler içerebilir.Expression can contain non-numeric characters. IsNumeric``True Expression geçerli bir onaltılık veya sekizlik sayı içeren bir dize ise döndürür.IsNumeric returns True if Expression is a string that contains a valid hexadecimal or octal number. IsNumeric Ayrıca True , Expression + veya-karakteriyle başlayan veya virgül içeren geçerli bir sayısal ifade içeriyorsa öğesini döndürür.IsNumeric also returns True if Expression contains a valid numeric expression that begins with a + or - character or contains commas.
IsNumeric``False Expression veri türünde ise döndürür Date .IsNumeric returns False if Expression is of data type Date. ,, False Expression Veya bir Char String Object sayıya başarıyla dönüştürülemediği takdirde döndürür.It returns False if Expression is a Char, String, or Object that cannot be successfully converted to a number.