@ReplaceFirst

@REPLACEFIRST 會以取代字串取代第一個出現的一般表示式。

DTP 類型:

可以將 @REPLACEFIRST 指派給字串密碼成員多個成員維度多個維度 類型的 DTP。

語法:

@REPLACEFIRST(String,Regular Expression,replaceString)

參數:

參數 描述
String 設計時期提示或文字
Regular Expression 設計時期提示或文字
replaceString 設計時期提示或文字

範例:

[ReplaceFirst_Str]=@REPLACEFIRST([String1],[Rep_String],[new_String])

其中:

  • [ReplaceFirst_Str] 是非勾選提示之字串 類型的 DTP。

  • [String1] 是勾選提示之字串 類型的 DTP。

  • [Rep_String] 是勾選提示之字串 類型的 DTP。

  • [new_String] 是勾選提示之字串 類型的 DTP。

假設參數如下:

  • 字串:"This is a testing of the new test of a test today"

  • 一般表示式:"Test"

  • 取代字串:"XYZ"

在此範例中,[ReplaceFirst_Str] 傳回:"This is a XYZing of the new test of a test today"。它只會取代測試中第一個出現的項目,不會取代所有出現的項目。