数组差集
使用 lodash _.difference 从数组中删除存在于其他数组中的值
此工具使用 lodash 的 `_.difference` 方法创建一个不包含在其他提供数组中的唯一值数组。
**功能:**
- 严格相等比较 (===)
- 支持多个排除数组
- 字符串区分大小写/不区分大小写比较
- 验证 JSON 数组输入格式
**示例:**
- 输入数组:`[2, 1, 2, 3]`
- 排除:`[2, 3]`
- 结果:`[1]`
API 文档
请求端点
POST /zh/api/tools/difference-arrays
请求参数
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
| array | textarea | 是 | - |
| exclude1 | textarea | 是 | 要从源数组中排除的值 |
| exclude2 | textarea | 否 | 要排除的其他值(可选) |
| exclude3 | textarea | 否 | 要排除的更多值(可选) |
| caseSensitive | checkbox | 否 | 对于字符串比较,取消选中以进行不区分大小写的匹配 |
响应格式
{
"result": "Processed text content",
"error": "Error message (optional)",
"message": "Notification message (optional)",
"metadata": {
"key": "value"
}
}
文本:
文本
AI MCP 文档
将此工具添加到您的 MCP 服务器配置中:
{
"mcpServers": {
"elysiatools-difference-arrays": {
"name": "difference-arrays",
"description": "使用 lodash _.difference 从数组中删除存在于其他数组中的值",
"baseUrl": "https://elysiatools.com/mcp/sse?toolId=difference-arrays",
"command": "",
"args": [],
"env": {},
"isActive": true,
"type": "sse"
}
}
}
你可以串联多个工具,比如:`https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`,最多20个。
如果遇见问题,请联系我们:[email protected]