> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spojit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Tools

> Split, join, replace, trim, convert case, slugify, and more string operations.

The Text Tools connector provides a comprehensive set of string manipulation operations for your workflows.

<Note>No connection required. This utility connector works out of the box.</Note>

## Tools

<AccordionGroup>
  <Accordion title="split: Split text by delimiter">
    <ParamField body="text" type="string" required>
      Text to split.
    </ParamField>

    <ParamField body="delimiter" type="string" required>
      Delimiter string or regex pattern.
    </ParamField>

    <ParamField body="isRegex" type="boolean" default="false">
      Treat delimiter as a regular expression.
    </ParamField>

    <ParamField body="limit" type="number">
      Maximum number of splits.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "one, two, three, four",
      "delimiter": ", ",
      "limit": 3
    }
    ```

    **Example response:**

    ```json theme={null}
    {
      "parts": ["one", "two", "three, four"],
      "count": 3
    }
    ```
  </Accordion>

  <Accordion title="join: Join strings together">
    <ParamField body="parts" type="string[]" required>
      Array of strings to join.
    </ParamField>

    <ParamField body="separator" type="string" default="">
      Separator between parts.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "parts": ["2026", "04", "02"],
      "separator": "-"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "2026-04-02" }
    ```
  </Accordion>

  <Accordion title="replace: Find and replace">
    <ParamField body="text" type="string" required>
      Source text.
    </ParamField>

    <ParamField body="search" type="string" required>
      String or regex pattern to find.
    </ParamField>

    <ParamField body="replacement" type="string" required>
      Replacement text.
    </ParamField>

    <ParamField body="isRegex" type="boolean" default="false">
      Treat search as a regular expression.
    </ParamField>

    <ParamField body="replaceAll" type="boolean" default="true">
      Replace all occurrences (or just the first).
    </ParamField>

    <ParamField body="flags" type="string" default="g">
      Regex flags (when `isRegex` is true).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "Hello World! Hello Universe!",
      "search": "Hello",
      "replacement": "Hi",
      "replaceAll": true
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "Hi World! Hi Universe!" }
    ```
  </Accordion>

  <Accordion title="trim: Remove whitespace">
    <ParamField body="text" type="string" required>
      Text to trim.
    </ParamField>

    <ParamField body="mode" type="string" default="both">
      Trim mode: `both`, `start`, or `end`.
    </ParamField>

    <ParamField body="chars" type="string">
      Specific characters to trim (whitespace if omitted).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "---Hello World---",
      "chars": "-"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "Hello World" }
    ```
  </Accordion>

  <Accordion title="case: Convert text case">
    <ParamField body="text" type="string" required>
      Text to convert.
    </ParamField>

    <ParamField body="to" type="string" required>
      Target case: `upper`, `lower`, `title`, `sentence`, `camel`, `pascal`, `snake`, `kebab`, `constant`, `dot`, `path`, or `capital`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "user first name",
      "to": "camel"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "userFirstName" }
    ```
  </Accordion>

  <Accordion title="truncate: Truncate with ellipsis">
    <ParamField body="text" type="string" required>
      Text to truncate.
    </ParamField>

    <ParamField body="length" type="number" required>
      Maximum length.
    </ParamField>

    <ParamField body="ellipsis" type="string" default="...">
      Ellipsis string.
    </ParamField>

    <ParamField body="preserveWords" type="boolean" default="false">
      Truncate at word boundaries.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "The quick brown fox jumps over the lazy dog",
      "length": 20,
      "preserveWords": true
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "The quick brown..." }
    ```
  </Accordion>

  <Accordion title="pad: Pad text to length">
    <ParamField body="text" type="string" required>
      Text to pad.
    </ParamField>

    <ParamField body="length" type="number" required>
      Target length.
    </ParamField>

    <ParamField body="char" type="string" default=" ">
      Pad character.
    </ParamField>

    <ParamField body="position" type="string" default="end">
      Pad position: `start`, `end`, or `both`.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "42",
      "length": 6,
      "char": "0",
      "position": "start"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "000042" }
    ```
  </Accordion>

  <Accordion title="slugify: Convert to URL slug">
    <ParamField body="text" type="string" required>
      Text to convert.
    </ParamField>

    <ParamField body="lowercase" type="boolean" default="true">
      Convert to lowercase.
    </ParamField>

    <ParamField body="separator" type="string" default="-">
      Word separator.
    </ParamField>

    <ParamField body="strict" type="boolean" default="true">
      Strip special characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "My Blog Post: A New Beginning!"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "my-blog-post-a-new-beginning" }
    ```
  </Accordion>

  <Accordion title="reverse: Reverse text">
    <ParamField body="text" type="string" required>
      Text to reverse.
    </ParamField>

    <ParamField body="byWords" type="boolean" default="false">
      Reverse word order instead of characters.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "the quick brown fox",
      "byWords": true
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "fox brown quick the" }
    ```
  </Accordion>

  <Accordion title="count-words: Count words">
    <ParamField body="text" type="string" required>
      Text to count.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "The quick brown fox jumps over the lazy dog"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "count": 9 }
    ```
  </Accordion>

  <Accordion title="count-chars: Count characters">
    <ParamField body="text" type="string" required>
      Text to count.
    </ParamField>

    <ParamField body="includeSpaces" type="boolean" default="true">
      Include spaces in the count.
    </ParamField>

    <ParamField body="includeNewlines" type="boolean" default="true">
      Include newlines in the count.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "Hello World",
      "includeSpaces": false
    }
    ```

    **Example response:**

    ```json theme={null}
    { "count": 10 }
    ```
  </Accordion>

  <Accordion title="substring: Extract substring">
    <ParamField body="text" type="string" required>
      Source text.
    </ParamField>

    <ParamField body="start" type="number" required>
      Start index (0-based).
    </ParamField>

    <ParamField body="end" type="number">
      End index (exclusive).
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "Hello World",
      "start": 6,
      "end": 11
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "World" }
    ```
  </Accordion>

  <Accordion title="repeat: Repeat text">
    <ParamField body="text" type="string" required>
      Text to repeat.
    </ParamField>

    <ParamField body="count" type="number" required>
      Number of repetitions (0–1000).
    </ParamField>

    <ParamField body="separator" type="string" default="">
      Separator between repetitions.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "na",
      "count": 4,
      "separator": " "
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": "na na na na" }
    ```
  </Accordion>

  <Accordion title="contains: Check if text contains substring">
    <ParamField body="text" type="string" required>
      Text to search.
    </ParamField>

    <ParamField body="search" type="string" required>
      Substring to find.
    </ParamField>

    <ParamField body="ignoreCase" type="boolean" default="false">
      Case-insensitive search.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "Error: Connection refused",
      "search": "error",
      "ignoreCase": true
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": true }
    ```
  </Accordion>

  <Accordion title="starts-with: Check prefix">
    <ParamField body="text" type="string" required>
      Text to check.
    </ParamField>

    <ParamField body="prefix" type="string" required>
      Prefix to check for.
    </ParamField>

    <ParamField body="ignoreCase" type="boolean" default="false">
      Case-insensitive check.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "https://api.example.com/v1/users",
      "prefix": "https://"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": true }
    ```
  </Accordion>

  <Accordion title="ends-with: Check suffix">
    <ParamField body="text" type="string" required>
      Text to check.
    </ParamField>

    <ParamField body="suffix" type="string" required>
      Suffix to check for.
    </ParamField>

    <ParamField body="ignoreCase" type="boolean" default="false">
      Case-insensitive check.
    </ParamField>

    **Example request:**

    ```json theme={null}
    {
      "text": "report_2026.pdf",
      "suffix": ".pdf"
    }
    ```

    **Example response:**

    ```json theme={null}
    { "result": true }
    ```
  </Accordion>
</AccordionGroup>
