You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionnaturalSort(arr: string[]): string[]{returnarr.sort((a,b)=>{// 提取 a 和 b 中的所有數字constnumsA=a.match(/\d+/g)?.map(Number)||[];constnumsB=b.match(/\d+/g)?.map(Number)||[];// 比較提取的數字for(leti=0;i<Math.min(numsA.length,numsB.length);i++){if(numsA[i]!==numsB[i]){returnnumsA[i]-numsB[i];}}// 如果提取的數字部分相等,則比較數字的數量(長度)returnnumsA.length-numsB.length;});}
以下是同一組文件在Windows中的排序和在rename中的排序
Windows
rename
The text was updated successfully, but these errors were encountered: