文字与文档工具

文本截取

在浏览器中把整段文本或每一行截到精确的最大长度,可保留开头或结尾,并选择无标记、单字省略号、三点或最多20字符的自定义标记;标记占用最大长度,只有原值超长时才添加。长度可按显示字素簇或Unicode码点计算,逐行模式保留空行与尾部空行并统一行尾。输入最多100,000字符、逐行最多50,000行,输出最多500,000字符。

优先本地处理无需注册隐私说明 ↗

Maximum 100,000 characters. Per-line mode supports up to 50,000 lines and preserves empty and trailing lines.

A whole number from 0 to 100,000, including the optional indicator.

Added only when a processed value exceeds the maximum.

使用步骤

如何使用

  1. Enter up to 100,000 characters and choose complete-text or per-line processing.
  2. Choose which side to keep, the maximum displayed-grapheme or code-point length, and an optional indicator.
  3. Truncate only values that exceed the maximum, then copy the result or download a text file.

The maximum includes the indicator

Keep beginning removes content from the right and places the indicator at the end. Keep ending removes content from the left and places the indicator at the beginning. The indicator consumes part of the selected maximum, so its unit count cannot exceed that maximum. Values already within the limit remain exactly unchanged and receive no indicator. A maximum of zero produces an empty result when no non-empty indicator is selected.

Unicode units and line scope are explicit

Displayed-grapheme mode uses browser Unicode segmentation so combining sequences, flags, emoji modifiers, and joined emoji normally stay intact. Code-point mode counts every Unicode scalar value separately and can split a displayed sequence. Complete-text mode counts LF line breaks as units. Per-line mode keeps line order, normalizes CRLF and CR to LF, and truncates each line independently, including empty and trailing lines. Input is limited to 100,000 UTF-16 characters, per-line mode to 50,000 lines, and output to 500,000 UTF-16 characters.

常见问题

你可能还想知道

Is the indicator added when the text already fits?

No. A value whose selected-unit length is at or below the maximum is returned unchanged.

Does the indicator count toward the maximum?

Yes. With a maximum of 20 and a three-dot indicator, at most 17 source units remain.

Will emoji stay together?

Usually in displayed-grapheme mode. Code-point mode intentionally counts and can separate the underlying Unicode components.