XsltFunctions.SubstringBefore(String, String) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
依據 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的字串。
傳回
s1 中出現在 s2 之前的字元,或若 s1 不包含 s2,則為空字串。
備註
在字串 (s1) 中定位子串 (s2),並回傳出現在 s2 之前的 s1 字元。