RuleBasedCollator.GetCollationKey(String) 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
从此 RuleBasedCollator 获取参数 String 源的排序规则键。
[Android.Runtime.Register("getCollationKey", "(Ljava/lang/String;)Landroid/icu/text/CollationKey;", "", ApiSince=24)]
public override Android.Icu.Text.CollationKey? GetCollationKey(string? source);
[<Android.Runtime.Register("getCollationKey", "(Ljava/lang/String;)Landroid/icu/text/CollationKey;", "", ApiSince=24)>]
override this.GetCollationKey : string -> Android.Icu.Text.CollationKey
参数
- source
- String
要转换为排序规则键的文本字符串。
返回
基于此 RuleBasedCollator 排序规则的给定字符串的 CollationKey。 如果源字符串为 null,则返回 null CollationKey。
- 特性
注解
从此 RuleBasedCollator 获取参数 String 源的排序规则键。
一般建议: <br> 如果要多次对同一字符串执行比较,则为字符串生成 CollationKeys 并使用 CollationKey.compareTo(CollationKey)进行比较会更高效。 如果每个字符串仅比较一次,则使用 RuleBasedCollator.compare(String, String) 方法将具有更好的性能。
有关 CollationKeys 的说明,请参阅类文档。
Java文档android.icu.text.RuleBasedCollator.getCollationKey(java.lang.String)。
本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。