Skip to content
UniKit

List slicer before a delimiter

Keep only the text before a delimiter on every line of a list — by default before the first delimiter, which turns an email address into its user name, or before the last one, with unmatched lines kept as is by default and matched/missed counters.

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

List

Slice result

One item per line, delimiter matched literally, ready to copy.

Paste a list and a delimiter to slice before it

Lines: 0 · Matched: 0 · Missed: 0

What this tool does

  • Take only the left side of compound fields such as emails, URLs or name-id pairs for matching or deduping.
  • Drop the extension from file.name, or keep only the scheme from lines that start with https://.
  • Split code-name and keep the code so it can be used as a sort key.

Example

Input

alice@example.com
bob@example.com

Output

alice
bob

Everything before the first @ remains, so alice@example.com becomes alice.

Frequently asked questions

Which separator wins when a line has several?

The first one by default (a@b@c gives a). Switch “Which segment” to “Before the last delimiter” to get a@b instead.

What happens to lines without the delimiter?

They are kept as is by default and counted as missed. Tick “Drop unmatched lines” to remove them so only sliced lines remain.

How long can the delimiter be?

Any length, matched literally rather than as a regular expression — `://`, ` - ` or `::` all work. An empty delimiter is rejected: it would mean “before every character”.

Is this the mirror of “slice after a delimiter”?

Yes. Both share the same delimiter and match rules and simply take the left or the right side, so using them together splits a line into two columns.

How are Chinese characters counted?

This tool locates text by the delimiter string and never counts characters, so Chinese characters and emoji cannot be cut in half; only position-based tools need to care about code-point counting.

Keywords:截取之前取分隔符前before delimitersplit before取 at 前截取指定字符前list before字符串前截取

Related tools