Share via


StringExtensions.AsInt Method

Include Protected Members
Include Inherited Members

Converts a string to an integer.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

Overload List

  Name Description
Public methodStatic member AsInt(String) Converts a string to an integer.
Public methodStatic member AsInt(String, Int32) Converts a string to an integer and specifies a default value.

Top

Remarks

The integer data type is used for 32-bit whole numbers of the type Int32.

Use the AsInt methods to convert a numeric value in string format to a an integer. Before you try to convert, you can check whether the string can be converted to this type by calling the IsInt(String) method, which true if the value can be converted.

See Also

Reference

StringExtensions Class

System.Web.WebPages Namespace