我正在尝试仅按字母对包含数字的字符串数组进行排序,例如:
Original array = {"09Bananas", "Pears2", "Mangoes39Bad", "100Apples", "Mangoes38Good"}
应该变成:
Sorted array = {"100Apples", "09Bananas", "Mangoes39Bad", "Mangoes38Good", "Pears2"}
但是,当我尝试使用Array.sort(original)
它时会出现这样的结果:
{"09Bananas", "100Apples", "Mangoes38Good", "Mangoes39Bad", "Pears2"}
是否有过载Array.sort
会使其忽略数字?
谢谢