Lightroom SDK: LrStringUtils.compareStrings() doesn't compare strings with digits correctly

  • 1
  • Problem
  • Updated 12 months ago
  • Solved
  • (Edited)
LrStringUtils.compareStrings() doesn't compare strings containing digits correctly.  For example, it says that "a9b" comes before "a10b":

It appears that compareStrings() is comparing sequences of digits numerically, e.g. as the numbers 9 and 10 in the example above.   While that definition can be useful in some cases, such as ordering filenames containing sequence numbers, it is not generally useful for sorting.  

The SDK should restore the traditional meaning to compareStrings() and optionally provide a second compare function for the current functionality.
Photo of John R. Ellis

John R. Ellis, Champion

  • 4062 Posts
  • 1070 Reply Likes

Posted 2 years ago

  • 1
Photo of Melissa Rios

Melissa Rios, Lightroom Support Product Manager

  • 104 Posts
  • 25 Reply Likes
Official Response
Hi all,

This issue should be fixed in today's Lightroom Classic CC 7.2 version. Please update your application and let us know if you still see this issue!

Lightroom Classic CC 7.2 is now available!