InetAddresses.IsNumericAddress(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Checks to see if the address
is a numeric address (such as "192.0.2.1"
or
"2001:db8::1:2"
).
[Android.Runtime.Register("isNumericAddress", "(Ljava/lang/String;)Z", "", ApiSince=29)]
public static bool IsNumericAddress (string address);
[<Android.Runtime.Register("isNumericAddress", "(Ljava/lang/String;)Z", "", ApiSince=29)>]
static member IsNumericAddress : string -> bool
Parameters
- address
- String
the address to parse.
Returns
true if the supplied address is numeric, false otherwise.
- Attributes
Remarks
Checks to see if the address
is a numeric address (such as "192.0.2.1"
or "2001:db8::1:2"
).
A numeric address is either an IPv4 address containing exactly 4 decimal numbers or an IPv6 numeric address. IPv4 addresses that consist of either hexadecimal or octal digits or do not have exactly 4 numbers are not treated as numeric.
This method will never do a DNS lookup.
Java documentation for android.net.InetAddresses.isNumericAddress(java.lang.String)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.