Char.IsLowSurrogate(字符串,Int32)将在C#方法
C#中的Char.IsLowSurrogate()方法指示字符串中指定位置的Char对象是否为低代理。
语法
以下是语法-
public static bool IsLowSurrogate (string str, int index);
以上,str是一个字符串,而该指数是字符的str中评估的位置。
示例
现在让我们来看看实现Char.IsLowSurrogate()方法的例子-
using System;
public class Demo {
public static void Main(){
string str = new String(new char[] { 'k', 'm', 'g', 't', 'j', 'p', '\uDC00' });
bool res = Char.IsLowSurrogate(str, 6);
if (res)
Console.WriteLine("Contains Low Surrogate value!");
else
Console.WriteLine("Does not contain Low Surrogate value!");
}
}输出结果
这将产生以下输出-
Contains Low Surrogate value!
示例
现在让我们来看另一个示例-
using System;
public class Demo {
public static void Main(){
string str = new String(new char[] { 'k', 'm', 'g', 't', 'j', 'p', '\uDC00' });
bool res = Char.IsLowSurrogate(str, 3);
if (res)
Console.WriteLine("Contains Low Surrogate value!");
else
Console.WriteLine("Does not contain Low Surrogate value!");
}
}输出结果
这将产生以下输出-
Does not contain Low Surrogate value!
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短