Skip to content
UniKit

List left cutter

Keep only the first N characters of every line in a line-based list — counted by Unicode code points so Chinese characters and emoji are never sliced in half, whole lines kept when N is longer, with an optional ellipsis marker and truncation statistics.

Runs in your browserEvery computation happens in your browser — your data never leaves this device.

List

Cut result

One item per line, counted by Unicode code points, ready to copy.

Paste a list to keep the left N characters of each line

Lines: 0 · Truncated: 0 · Characters kept: 0

What this tool does

  • Compress a column of code-plus-name strings into fixed-width labels, e.g. keep only the order prefix.
  • Skim a log or scrape dump by reading just the first N characters of each line.
  • Trim long paths or URLs to a fixed prefix so the list pastes neatly into a sheet.

Example

Input

apple-pie
banana-bread
kiwi

Output

apple-
banana
kiwi

With N = 6 every line keeps its first six characters; kiwi is shorter than 6 and stays untouched.

Frequently asked questions

How are Chinese characters and emoji counted?

One Chinese character is 1 and one emoji is 1, because counting walks Unicode code points — that is why an emoji never becomes a replacement character. Composite emoji such as skin-tone variants count as several code points; use the text truncate tool for grapheme precision.

What if N is longer than the line?

The line is kept as is — no error and no padding. One N therefore handles a list of mixed lengths; the truncation counter only counts lines that really lost characters.

What happens with a negative or fractional N?

It reports an error instead of silently treating it as 0. N must be an integer no smaller than 0; with N = 0 every line becomes empty and is then dropped as a blank line.

Are blank lines kept?

No, they are dropped by default, including lines that became empty after cutting. Turn off “Drop blank lines” to keep them as empty entries in the output.

Keywords:列表截取取左边n个字符cut leftleft substring每行截取前n个字符list cut按字符截断

Related tools