StringPrototype.replace(Object, Object, Object) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
對第一個指定物件執行指定的正則表達式模式搜尋,並將任何匹配的物件替換為第三個指定的物件。
此 API 支援此產品基礎結構,但無法直接用於程式碼之中。
public:
static System::String ^ replace(System::Object ^ thisob, System::Object ^ regExp, System::Object ^ replacement);
[Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.String_replace)]
public static string replace(object thisob, object regExp, object replacement);
[<Microsoft.JScript.JSFunction(Microsoft.JScript.JSFunctionAttributeEnum.HasThisObject, Microsoft.JScript.JSBuiltin.String_replace)>]
static member replace : obj * obj * obj -> string
Public Shared Function replace (thisob As Object, regExp As Object, replacement As Object) As String
參數
- thisob
- Object
這個方法作用的對象。
- regExp
- Object
要搜尋的正則表達式模式。
- replacement
- Object
任何火柴的替代品。
傳回
換新弦,換好後再換。
- 屬性