★LocalHost Run Under Construction
  • 首页
  • 文章
  • 工具
http://localhost
首页文章工具
全部工具›列表工具›列表分块

列表分块

将列表按固定大小拆分为连续块。可自定义分隔符与包裹符号,并可选填充不完整的最后一组。

输入列表

​

分组输出

​

工具选项

输入项分隔符

使用符号拆分

使用单个字符拆分输入项。

使用正则拆分

使用正则表达式拆分输入项。

​

用于拆分输入项的分隔符或正则表达式。

组大小与输出格式

​

每组包含的项目数量

​

组内项目之间的分隔符

​

组与组之间的分隔符

​

每组前添加的符号

​

每组后添加的符号

空项与填充

忽略空项,不纳入结果。

若最后一组项目不足,用填充字符补齐。

​

用于填充不完整组的字符或值。


列表分块 示例

点击尝试!

Group Hexagon Coordinates

In this example, we group the coordinates of a regular hexagon. The input coordinates are given as a space-separated list "x1 y1 x2 y2 x3 y3 …". What we want to do is create vector point pairs such as "(x1, y1); (x2, y2); (x3, y3); …". To do that, we use the space character as the input coordinate separator, and to create vectors, we group them by pairs. We wrap the coordinates in parentheses, put a comma between the x and y group items, and a semicolon between individual groups.

​
​

输入项分隔符

使用符号拆分

使用单个字符拆分输入项。

使用正则拆分

使用正则表达式拆分输入项。

​

用于拆分输入项的分隔符或正则表达式。

组大小与输出格式

​

每组包含的项目数量

​

组内项目之间的分隔符

​

组与组之间的分隔符

​

每组前添加的符号

​

每组后添加的符号

空项与填充

忽略空项,不纳入结果。

若最后一组项目不足,用填充字符补齐。

​

用于填充不完整组的字符或值。

Chunks of Size 3

This example demonstrates grouping of list items and creates 9 groups of 3 items. The input list contains all alphabet letters (26 letters, separated by a semicolon) and the output is groups of letter trigrams. As the last group is missing one letter, we enable padding and add the underscore symbol as the padding element.

​
​

输入项分隔符

使用符号拆分

使用单个字符拆分输入项。

使用正则拆分

使用正则表达式拆分输入项。

​

用于拆分输入项的分隔符或正则表达式。

组大小与输出格式

​

每组包含的项目数量

​

组内项目之间的分隔符

​

组与组之间的分隔符

​

每组前添加的符号

​

每组后添加的符号

空项与填充

忽略空项,不纳入结果。

若最后一组项目不足,用填充字符补齐。

​

用于填充不完整组的字符或值。

Convert a List to a TSV

In this example, we use our list item grouper to convert a food list to tab-separated values (TSV). As spaces are chaotically used between the items of the input list, we use the item separating regular expression "\s+" to match them. We create a TSV with three columns (three groups), separate them with a tab character, and put newlines between the groups.

​
​

输入项分隔符

使用符号拆分

使用单个字符拆分输入项。

使用正则拆分

使用正则表达式拆分输入项。

​

用于拆分输入项的分隔符或正则表达式。

组大小与输出格式

​

每组包含的项目数量

​

组内项目之间的分隔符

​

组与组之间的分隔符

​

每组前添加的符号

​

每组后添加的符号

空项与填充

忽略空项,不纳入结果。

若最后一组项目不足,用填充字符补齐。

​

用于填充不完整组的字符或值。


全部 列表工具


  • 种类 — 按指定顺序对列表项进行排序
  • 展开 — 从结构化格式中解开列表项
  • 撤销 — 快速反转列表
  • 寻找独特的 — 在列表中查找唯一项
  • 查找最受欢迎的 — 查找最常出现的项目
  • 裹 — 使用指定条件包装列表项
  • 旋转 — 按指定位置旋转列表项
  • 随机播放 — 随机化列表项的顺序
  • 截短 — 将列表截断为指定数量的项目
  • 复制 — 按照指定条件复制列表项

LocalHost Run · 联系我们 · 隐私政策 · 使用条款

© 2026 LocalHost Run · localhost 指南、文章与开发者工具 · localhostrun.com
访客计数: 1025Best viewed in Netscape Navigator · 800×600© LocalHost Run