StringExtensions 類別

定義

提供公用程式方法,以用來將字串值轉換成其他資料型別。

public static class StringExtensions
type StringExtensions = class
Public Module StringExtensions
繼承
StringExtensions

方法

As<TValue>(String)

將字串轉換成指定資料型別的強型別值。

As<TValue>(String, TValue)

將字串轉換成指定的資料型別並指定預設值。

AsBool(String)

將字串轉換成布林 (true/false) 值。

AsBool(String, Boolean)

將字串轉換成布林 (true/false) 值並指定預設值。

AsDateTime(String)

將字串轉換成 DateTime 值。

AsDateTime(String, DateTime)

將字串轉換為 DateTime 值,並指定預設值。

AsDecimal(String)

將字串轉換成 Decimal 數位。

AsDecimal(String, Decimal)

將字串轉換成 Decimal 數位,並指定預設值。

AsFloat(String)

將字串轉換成 Single 數位。

AsFloat(String, Single)

將字串轉換成 Single 數位,並指定預設值。

AsInt(String)

將字串轉換成整數。

AsInt(String, Int32)

將字串轉換成整數並指定預設值。

Is<TValue>(String)

檢查是否可以將字串轉換成指定的資料型別。

IsBool(String)

檢查是否可以將字串轉換成布林 (true/false) 型別。

IsDateTime(String)

檢查字串是否可以轉換成 DateTime 類型。

IsDecimal(String)

檢查字串是否可以轉換成 Decimal 類型。

IsEmpty(String)

檢查字串值是否為 Null 或空白。

IsFloat(String)

檢查字串是否可以轉換成 Single 類型。

IsInt(String)

檢查是否可以將字串轉換成整數。

適用於