Home > other >  Lua implementation algorithm according to the first letter sequence of Chinese characters
Lua implementation algorithm according to the first letter sequence of Chinese characters

Time:09-18

Turn a lua implementation method of Chinese characters according to the first letter

CodePudding user response:

Var array=[' wuhan ', 'Beijing', 'Shanghai', 'tianjin'].
Var resultArray=array. Sort (
The function compareFunction (param1, param2) {
Return param1. LocaleCompare (param2, "useful");
}
);
The console. The log (resultArray);
  • Related