共用方式為


Float.ParseFloat(String) Method

Definition

Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float.

[Android.Runtime.Register("parseFloat", "(Ljava/lang/String;)F", "")]
public static float ParseFloat (string s);
[<Android.Runtime.Register("parseFloat", "(Ljava/lang/String;)F", "")>]
static member ParseFloat : string -> single

Parameters

s
String

the string to be parsed.

Returns

the float value represented by the string argument.

Attributes

Exceptions

if string can not be parsed as a float value.

Remarks

Returns a new float initialized to the value represented by the specified String, as performed by the valueOf method of class Float.

Added in 1.2.

Java documentation for java.lang.Float.parseFloat(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.

Applies to

See also