「降順で並び替え」の版間の差分

ページの作成:「;説明 編集中の文書の行を降順で並べ替えます。 ;構文 <source lang="javascript"> // --------------------------------------------------------------...」
 
編集の要約なし
15行目: 15行目:
if (document.selection.Text == "")
if (document.selection.Text == "")
   document.selection.SelectAll();
   document.selection.SelectAll();
document.selection.Text = document.selection.Text.split("\n")
document.selection.Text = document.selection.Text.split("\n").sort(function(a, b){ return ((a < b) ? 1 : ((a > b) ? -1 : 0)) }).join("\n");
  .sort(function(a, b){ return ((a < b) ? 1 : ((a > b) ? -1 : 0)) }).join("\n");
document.selection.StartOfDocument();
document.selection.StartOfDocument();
</source>
</source>
スポンサーリンク