Groovyで文字列の長さの順序でのArrayList
を並べ替えるにはどうすればよいですか?String
コード:
def words = ['groovy', 'is', 'cool']
// your code goes here:
// code that sorts words in ascending length-of-word order
assert words == ['is', 'cool', 'groovy']
それを行うには確かに複数の方法があります-それで私は最もエレガントな解決策を提供する人に答えを与えます。