Module:Sort list៖ ភាពខុសគ្នារវាងកំណែនានា

ខ្លឹមសារដែលបានលុបចោល ខ្លឹមសារដែលបានសរសេរបន្ថែម
បានបង្កើតទំព័រដែលផ្ដើមដោយ local p = {} function p.asc(frame) items = splitLine( frame.args[1] ); table.sort( items ); return table.c...
ស្លាក: កែ​សម្រួល​តាម​ទូរស័ព្ទ កំណែប្រែពីអ៊ីនធើណិតចល័ត Advanced mobile edit
 
(គ្មានភាពខុសគ្នា)

កំណែថ្មីបំផុតនៅ ម៉ោង០៣:១១ ថ្ងៃពុធ ទី២៦ ខែសីហា ឆ្នាំ២០២០

Documentation for this module may be created at Module:Sort list/doc

local p = {}

function p.asc(frame)
    items = splitLine( frame.args[1] );
    table.sort( items );
    return table.concat( items, "\n" );    
end

function p.desc(frame)
    items = splitLine( frame.args[1] );
    table.sort( items, function (a, b) return a > b end );
    return table.concat( items, "\n" );
end

function splitLine( text )
    return mw.text.split( text, "\n", true );    
end



return p