Categories

Drop While

Drop items from array while predicate is true using lodash _.dropWhile

This tool removes elements from the beginning of an array until the predicate returns false for the first time. **Features:** - Multiple predicate types for flexible filtering - Support for numeric and string comparisons - Works with arrays of any data type - Uses lodash's _.dropWhile for reliable operation **Example:** Input: `[1, 2, 3, 4, 5]` Predicate: Less than 3 Output: `[3, 4, 5]` (drops 1 and 2 because they are < 3) **Predicate Types:** - **less-than**: Drop while value < n - **greater-than**: Drop while value > n - **equals**: Drop while value === n - **not-equals**: Drop while value !== n - **string-contains**: Drop while string contains substring - **string-starts-with**: Drop while string starts with prefix - **string-ends-with**: Drop while string ends with suffix - **is-nullish**: Drop while value is null/undefined - **is-truthy**: Drop while value is truthy - **is-falsey**: Drop while value is falsey

Enter a JSON array

Select the condition for dropping elements

Value to compare against (required for most predicates)

API Documentation

Request Endpoint

POST /en/api/tools/drop-while

Request Parameters

Parameter Name Type Required Description
array textarea Yes Enter a JSON array
predicateType select Yes Select the condition for dropping elements
compareValue text No Value to compare against (required for most predicates)

Response Format

{
  "result": "Processed text content",
  "error": "Error message (optional)",
  "message": "Notification message (optional)",
  "metadata": {
    "key": "value"
  }
}
Text: Text

AI MCP Documentation

Add this tool to your MCP server configuration:

{
  "mcpServers": {
    "elysiatools-drop-while": {
      "name": "drop-while",
      "description": "Drop items from array while predicate is true using lodash _.dropWhile",
      "baseUrl": "https://elysiatools.com/mcp/sse?toolId=drop-while",
      "command": "",
      "args": [],
      "env": {},
      "isActive": true,
      "type": "sse"
    }
  }
}

You can chain multiple tools, e.g.: `https://elysiatools.com/mcp/sse?toolId=png-to-webp,jpg-to-webp,gif-to-webp`, max 20 tools.

If you encounter any issues, please contact us at [email protected]