RevealTheme logo

Trình làm sạch Văn bản

Loại bỏ khoảng trắng thừa, chuẩn hóa các dấu ngắt dòng, sửa các dấu nháy kiểu cách và làm sạch văn bản đã dán.

Cách sử dụng công cụ này

  1. 1

    Paste your messy text into the input box.

  2. 2

    Toggle the options you want: trim lines, collapse spaces, remove line breaks, replace tabs, and fix smart quotes.

  3. 3

    Read the cleaned result in the lower box, which updates live as you type or change options.

  4. 4

    Click 'Copy clean text' to copy the result to your clipboard.

Trình làm sạch Văn bản là gì?

Văn bản được dán từ PDF, các trang web hay Microsoft Word thường đi kèm với các tạp chất ẩn: dấu nháy kiểu cách (cong), dấu gạch ngang dài, dấu gạch nối mềm, khoảng trắng đôi, khoảng trắng ở cuối và sự lẫn lộn giữa tab và khoảng trắng. Công cụ này chuẩn hóa tất cả những thứ đó thành văn bản thuần túy sạch sẽ, sẵn sàng để dán vào các trình soạn thảo mã, biểu mẫu CMS hoặc các môi trường nghiêm ngặt khác.

Các trường hợp sử dụng phổ biến

  • Cleaning a quote pasted from a Word document before dropping it into source code, where curly apostrophes would cause syntax errors.

  • Flattening multi-line text copied from a PDF into a single line for a spreadsheet cell or search field using the remove-line-breaks toggle.

  • Removing the trailing spaces and tab-indented lines that sneak in when copying from a chat app or rendered web page.

  • Normalizing en-dashes and em-dashes to plain hyphens so a CSV or plain-text export stays ASCII-safe.

  • Tidying marketing copy pasted into a CMS field so double spaces after sentences collapse to single spaces.

  • Preparing a code comment or commit message by stripping the smart quotes and ellipses an editor auto-inserted.

Câu hỏi thường gặp

Tại sao dấu nháy kiểu cách lại không tốt?
Chúng phá vỡ cú pháp mã, làm hỏng các tệp xuất CSV và không hiển thị đúng cách trong một số môi trường. Đối với tài liệu thì chúng ổn; đối với nội dung kỹ thuật, hãy thay thế chúng.

Công cụ liên quan