Hi! I have to sort a list of strings based on a number within the string . . . I am able to sort using something like: list.sort( { a,b -> getVersion(a) <=> getVersion(b)})
I need to use this in a bunch of places in my code and was hoping to replace it with a method, like: list.sort( compareVersions) with compareVersions: def compareVersions(a, b) { return getVersion(a).toInteger() <=> getVersion(b).toInteger() } putting the method (compoareVersions) into the sort as a param doesn't work. Anyone know what I'm missing? Thanks!! Guy