gpt4 book ai didi

c# - Azure表存储: Which string comparison method is used?

转载 作者:太空宇宙 更新时间:2023-11-03 12:21:22 28 4
gpt4 key购买 nike

我想使用 RowKey >= MyRangeStart AND RowKey <= MyRangeEnd 查询 Azure 表存储中的实体范围.

但是,我找不到准确说明 Azure 表存储使用哪种字符串比较方法的文档。例如,在 C# 中,"a".CompareTo("A")根据当前文化产生不同的结果。

从实验来看,Azure Table Storage 执行的比较与 string.CompareOrdinal 相同。然而,如果能够确信这确实是正在使用的比较,那就太好了。

是否有任何官方文档描述所使用的字符串比较?

最佳答案

documentation 中所述,词法比较用于聚集索引。因此,这是最适合您的情况的情况。

The sort order is observed in all query responses. Lexical comparisons are used during the sorting operation. Therefore, a string value of "111" will appear before a string value of "2". In some cases, you may want the order to be numeric. To sort in a numeric and ascending order, you will need to use fixed-length, zero-padded strings. In the previous example, using "002" will allow it to appear before "111".

关于c# - Azure表存储: Which string comparison method is used?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47005929/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com