🔄 Line Order Reverser
📐 工作原理與說明
按 \n 切分為行陣列;可選對每行去首尾空白。若保留首行則取下標 0 原樣置於結果開頭,若保留末行則取最後一行原樣置於結果末尾,中間部分才參與倒序。跳過空行時:先記錄空行所在下標,把非空行倒序後按原下標回填空行;否則直接整體倒序。可選對每行做字元級反轉(空行跳過),最後用 \n 連線輸出,結果為空時顯示「(無內容)」
Reverse the order of lines with an option to keep or drop blank lines, useful for reversing checklists, replaying steps and handling reverse-chronological data.
選項
📋 反轉結果
請輸入文本...
📚 深度解析:行反轉
💡 常見使用場景
- 倒序輸出:把末行置頂、首行置底,適合日誌從新到舊展示。
- 棧式回放:按後進先出檢視列表。
- 資料翻轉:配合排序做降序排列的替代方案。
日誌倒序看最新
貼上 100 行日誌,行反轉後第 100 行(最新)變第 1 行,便於先看最近事件;行內文字不變,僅順序顛倒。
❓ 常見問題(FAQ)
- 和文本反轉區別?
- 文本反轉把整段當一串字元倒序(含行內),本工具只顛倒行順序、保留每行內容,更適合日誌與列表。
- 空行怎麼處理?
- 空行也作為一行參與反轉;若想忽略空行請先去空白。
Formula & Standard References
| Item | Formula / Note | Source / Standard |
|---|---|---|
| Line delimiter | line reversal splits on newlines and rejoins in reverse order | IEEE 1003.1, POSIX text files |
| Newline style | mixed carriage return styles should be unified before reversing | ISO/IEC 6429, control functions |
| Blank line retention | blank lines participate in reversal as ordinary lines | Unicode UAX #14, line breaking |
⚠️ 使用說明與注意事項
- 本工具純前端執行,資料不會上傳到伺服器
- 建議在主流瀏覽器(Chrome/Safari/Firefox/Edge)中使用
- 計算結果僅供參考,請以實際應用場景為準