Share via


XsltFunctions.SubstringBefore(String, String) 方法

定義

根據 W3C 規格 (英文) 實作 substring-before XPath 函式。

此 API 支援此產品基礎結構,但無法直接用於程式碼之中。

public:
 static System::String ^ SubstringBefore(System::String ^ s1, System::String ^ s2);
public static string SubstringBefore (string s1, string s2);
static member SubstringBefore : string * string -> string
Public Shared Function SubstringBefore (s1 As String, s2 As String) As String

參數

s1
String

要在其中尋找 s2 的字串。

s2
String

要在 s1 中尋找的字串。

傳回

String

s1 (出現在 s2 之前) 中的字元,如果 s1 不包含 s2 則為空字串。

備註

在 (s1) 的字串中尋找 (s2) 的子字串,並傳回 s2 中發生的字元。

適用於