I need to have an equivalent of the compareWith(a,b) method in Java, in Scala.
I have a list of strings and I need to sort them by comparing them with each other. sortBy just takes one string and returns a score, but that's not enough in my case, i need to compare two strings with each other and then return a number based on which one is better.
It seems like the only option is to write a custom case class, convert the strings to it, and then covert them back. For performance reasons, I want to avoid this as I have a large amount of data to process.
Is there a way to do this with just the strings?