---
title: "String"
description: "String operations for formatting, search, conversion, and helpers."
canonical_url: "https://docs.vettero.com/build/workflows/blocks/data-ops/string"
---
# String

> String operations for formatting, search, conversion, and helpers.

<block-meta block="Yes" channels="Any" folder="basic/data-ops" group="Data Operations" groupTo="/build/workflows/blocks/data-ops" icon="i-lucide-type" pipe="Value" scope="Any" tool="No" type="data-ops.string">



</block-meta>

**String** (canvas label **String ·** plus the operation) runs one text **Operation** and writes the result to the data pipe. **Search** / **Pattern** fields accept plain text or a `/pattern/flags` regex literal.

Use [Create Text](https://docs.vettero.com/build/workflows/blocks/data-ops/create-text) to assemble a template. Use [Hash](https://docs.vettero.com/build/workflows/blocks/utility/hash) when you need bcrypt. **String → Hash** supports Node digest names such as `sha256` (default), `md5`, `sha1`, and `sha512`.

## Configure

<table>
<thead>
  <tr>
    <th>
      Setting
    </th>
    
    <th>
      Description
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Operation
      </strong>
    </td>
    
    <td>
      Grouped list. Changing it resets the other fields
    </td>
  </tr>
  
  <tr>
    <td>
      Remaining fields
    </td>
    
    <td>
      Depend on <strong>
        Operation
      </strong>
      
       (for example <strong>
        String
      </strong>
      
      , <strong>
        Search
      </strong>
      
      , <strong>
        Length
      </strong>
      
      )
    </td>
  </tr>
</tbody>
</table>

## Handles

<table>
<thead>
  <tr>
    <th>
      Handle
    </th>
    
    <th>
      Role
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        In
      </strong>
      
       (target)
    </td>
    
    <td>
      Incoming connection
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Out
      </strong>
      
       (source)
    </td>
    
    <td>
      Continues after the operation
    </td>
  </tr>
</tbody>
</table>

## Pipe schema

The next block reads this on the data pipe (`pipe.value`). The type depends on **Operation**: text, number, true/false, a list of text, or a parsed JSON value (**To JSON**).

## Operations

### Core

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Create
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Value
      </strong>
      
       — convert to text
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Is empty
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        String
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Length
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        String
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Case and trim

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        To upper
      </strong>
      
       / <strong>
        To lower
      </strong>
    </td>
    
    <td>
      text
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Trim
      </strong>
      
       / <strong>
        Trim start
      </strong>
      
       / <strong>
        Trim end
      </strong>
    </td>
    
    <td>
      text
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Capitalize
      </strong>
    </td>
    
    <td>
      text — first character
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Capitalize all
      </strong>
    </td>
    
    <td>
      text — each word
    </td>
  </tr>
</tbody>
</table>

Each of these takes **String**.

### Search and match

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Includes
      </strong>
      
       / <strong>
        Starts with
      </strong>
      
       / <strong>
        Ends with
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Search
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Index of
      </strong>
      
       / <strong>
        Last index of
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Search
      </strong>
      
       (<code>
        -1
      </code>
      
       if missing)
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Match
      </strong>
    </td>
    
    <td>
      list of text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Pattern
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Replace, concat, split

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Replace
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Search
      </strong>
      
      , <strong>
        Value
      </strong>
      
       — first match
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Replace all
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      Same fields — every match
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Concat
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Strings (array)
      </strong>
      
       — no separator
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Repeat
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Count
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Split
      </strong>
    </td>
    
    <td>
      list of text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Separator
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Join
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        Array
      </strong>
      
      , <strong>
        Separator
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Extract and pad

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Substring
      </strong>
      
       / <strong>
        Slice
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Start
      </strong>
      
      , optional <strong>
        End
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Char at
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Index
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Pad start
      </strong>
      
       / <strong>
        Pad end
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Length
      </strong>
      
      , optional <strong>
        Fill
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Compare and validate

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Equals
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
      
       — case-sensitive
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Equals ignore case
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Compare
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        A
      </strong>
      
      , <strong>
        B
      </strong>
      
       — <code>
        -1
      </code>
      
      , <code>
        0
      </code>
      
      , or <code>
        1
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Is alpha
      </strong>
      
       / <strong>
        Is numeric
      </strong>
      
       / <strong>
        Is alphanumeric
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        String
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Is email
      </strong>
      
       / <strong>
        Is URL
      </strong>
      
       / <strong>
        Is UUID
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        String
      </strong>
    </td>
  </tr>
</tbody>
</table>

### Convert

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        To number
      </strong>
    </td>
    
    <td>
      number
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
       — fails if empty or not finite
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        To boolean
      </strong>
    </td>
    
    <td>
      true/false
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
       — <code>
        true
      </code>
      
      /<code>
        false
      </code>
      
      , <code>
        1
      </code>
      
      /<code>
        0
      </code>
      
      , <code>
        yes
      </code>
      
      /<code>
        no
      </code>
      
      , <code>
        on
      </code>
      
      /<code>
        off
      </code>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        To JSON
      </strong>
    </td>
    
    <td>
      any
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
       — parsed JSON
    </td>
  </tr>
</tbody>
</table>

### Helpers

<table>
<thead>
  <tr>
    <th>
      Operation
    </th>
    
    <th>
      Result
    </th>
    
    <th>
      Inputs
    </th>
  </tr>
</thead>

<tbody>
  <tr>
    <td>
      <strong>
        Truncate
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Length
      </strong>
      
       — hard cut
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Ellipsis
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Length
      </strong>
      
       — adds <code>
        ...
      </code>
      
       when truncated
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Reverse
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Remove
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , <strong>
        Pattern
      </strong>
      
       — all matches removed
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Normalize
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
       — Unicode NFC
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Slugify
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
       — URL-friendly slug
    </td>
  </tr>
  
  <tr>
    <td>
      <strong>
        Hash
      </strong>
    </td>
    
    <td>
      text
    </td>
    
    <td>
      <strong>
        String
      </strong>
      
      , optional <strong>
        Algorithm
      </strong>
      
       (default <code>
        sha256
      </code>
      
      ) — hex digest
    </td>
  </tr>
</tbody>
</table>

## Use case

- **Trim** and **Slugify** a title before storing it.
- **Split** a comma-separated field, then loop with [For Of](https://docs.vettero.com/build/workflows/blocks/loops/for-of) or [Array](https://docs.vettero.com/build/workflows/blocks/data-ops/array).
- **Is email** before writing a contact row.

<block-page-nav>



</block-page-nav>


## Sitemap

See the full [sitemap](https://docs.vettero.com/sitemap.md) for all pages.
