XsltFunctions.SubstringBefore(String, String) 方法

定义

substring-before根据 W3C 规范实现 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),并返回 s1 中的字符(s2)。

适用于