String Operations Guide: All 20 Text Transformations
A complete guide to substring, replace, trim, pad, case changes, split, concatenate, length, contains, extract pattern, and 10 more string operations.
String Operations Guide: All 20 Text Transformations
This guide explains every string (text) operation: what it does, when to use it, and how to run it step by step.
---
1. Substring
Plain English: Extracts a portion of text from a specified start position and length.
When to use: You need the first 3 characters of a code, the middle of a string, or a fixed-width part of text.
Step-by-step:
- Select the text column.
- Choose Substring.
- Enter start position (1-based or 0-based, depending on the tool).
- Enter length (or end position).
- Name the new column and click Apply.
---
2. Replace
Plain English: Replaces old text with new text. Can replace all occurrences or just the first.
When to use: Fix typos, standardize values ("USA" and "U.S.A." → "United States"), or remove unwanted characters.
Step-by-step:
- Select the column.
- Choose Replace.
- Enter the text to find.
- Enter the replacement text.
- Choose "Replace all" or "Replace first".
- Click Apply.
---
3. Trim
Plain English: Removes extra spaces from the start and end of text. Does not change spaces in the middle.
When to use: Data was entered with accidental leading or trailing spaces that cause matching issues.
Step-by-step:
- Select the column.
- Choose Trim.
- Optionally choose "Trim left", "Trim right", or "Trim both".
- Click Apply.
---
4. Pad
Plain English: Adds characters (usually spaces or zeros) to the start or end until the string reaches a target length.
When to use: You need fixed-width codes (e.g., "00123" instead of "123") or aligned columns for export.
Step-by-step:
- Select the column.
- Choose Pad.
- Enter target length.
- Choose pad character (space, 0, or custom).
- Choose left or right padding.
- Click Apply.
---
5. Upper Case
Plain English: Converts all letters to uppercase (A–Z).
When to use: Standardizing text for matching or display (e.g., "john" → "JOHN").
Step-by-step:
- Select the column.
- Choose Upper Case.
- Click Apply.
---
6. Lower Case
Plain English: Converts all letters to lowercase (a–z).
When to use: Standardizing text for matching (e.g., "JOHN", "John", "john" all become "john").
Step-by-step:
- Select the column.
- Choose Lower Case.
- Click Apply.
---
7. Title Case
Plain English: Capitalizes the first letter of each word.
When to use: Display names, titles, or headers in a friendly format.
Step-by-step:
- Select the column.
- Choose Title Case.
- Click Apply.
---
8. Split
Plain English: Splits a text column into two or more columns using a delimiter (comma, space, dash, etc.).
When to use: Full names into first/last, "City, State" into separate columns, or pipe-separated values.
Step-by-step:
- Select the column.
- Choose Split.
- Enter the delimiter.
- Choose how many new columns or which part to keep.
- Name the new columns and click Apply.
---
9. Concatenate
Plain English: Joins two or more text columns into one, with an optional separator.
When to use: Combining first name + last name, city + state, or building full addresses.
Step-by-step:
- Choose Concatenate.
- Select the columns.
- Choose separator (space, comma, custom, or none).
- Name the new column and click Apply.
---
10. Length
Plain English: Counts the number of characters in each text value.
When to use: Filtering short/long entries, validating input length, or creating a length-based feature.
Step-by-step:
- Select the column.
- Choose Length.
- Name the new numeric column and click Apply.
---
11. Contains
Plain English: Checks whether text contains a given substring. Returns true or false.
When to use: Filtering rows (e.g., emails containing "@gmail.com") or creating boolean flags.
Step-by-step:
- Select the column.
- Choose Contains.
- Enter the substring.
- Choose case-sensitive or not.
- Click Apply.
---
12. StartsWith
Plain English: Checks whether text starts with a given substring. Returns true or false.
When to use: Filtering by prefix (e.g., codes starting with "A", URLs starting with "https").
Step-by-step:
- Select the column.
- Choose StartsWith.
- Enter the prefix.
- Choose case-sensitive or not.
- Click Apply.
---
13. EndsWith
Plain English: Checks whether text ends with a given substring. Returns true or false.
When to use: Filtering by suffix (e.g., files ending in ".csv", domains ending in ".com").
Step-by-step:
- Select the column.
- Choose EndsWith.
- Enter the suffix.
- Choose case-sensitive or not.
- Click Apply.
---
14. Extract Pattern
Plain English: Uses a regular expression (regex) to pull out a matching part of the text.
When to use: Extracting zip codes, phone numbers, email domains, or any structured pattern from text.
Step-by-step:
- Select the column.
- Choose Extract Pattern.
- Enter the regex (e.g., \\d{5} for 5-digit zip).
- Name the new column and click Apply.
---
15. Count Occurrence
Plain English: Counts how many times a substring appears in each text value.
When to use: Counting commas in CSV-like strings, occurrences of a word, or frequency of a character.
Step-by-step:
- Select the column.
- Choose Count Occurrence.
- Enter the substring to count.
- Click Apply.
---
16. Remove Whitespace
Plain English: Removes all whitespace characters (spaces, tabs, newlines) from text. Can reduce multiple spaces to one.
When to use: Cleaning messy text where extra spaces cause display or matching issues.
Step-by-step:
- Select the column.
- Choose Remove Whitespace.
- Choose "Remove all" or "Collapse to single space".
- Click Apply.
---
17. Reverse
Plain English: Reverses the order of characters in each text value.
When to use: Rare; sometimes used for encoding, palindromes, or special data formats.
Step-by-step:
- Select the column.
- Choose Reverse.
- Click Apply.
---
18. Repeat
Plain English: Repeats the text a specified number of times.
When to use: Creating test data, padding, or formatting (e.g., underline with "=" repeated).
Step-by-step:
- Select the column.
- Choose Repeat.
- Enter the number of repetitions.
- Click Apply.
---
19. Encode / Decode URL
Plain English:
- Encode: Converts special characters to URL-safe format (e.g., space → %20).
- Decode: Converts URL-encoded text back to normal.
Step-by-step:
- Select the column.
- Choose Encode URL or Decode URL.
- Click Apply.
---
20. Slug
Plain English: Converts text into a URL-friendly "slug": lowercase, spaces to hyphens, special characters removed.
When to use: Creating URLs from titles (e.g., "Hello World!" → "hello-world").
Step-by-step:
- Select the column.
- Choose Slug.
- Optionally choose the separator (hyphen, underscore).
- Click Apply.
---
21. Numerical to Categorical
Plain English: Converts a numeric column into text categories (e.g., 1–5 → "Low", "Medium", "High").
When to use: Grouping numbers into bins for reporting or analysis.
Step-by-step:
- Select the numeric column.
- Choose Numerical to Categorical.
- Define ranges and labels (e.g., 0–10 → "Low", 11–50 → "Medium", 51+ → "High").
- Click Apply.
---
Quick Reference
| Operation | Purpose |
|---|---|
| Substring | Extract part of text |
| Replace | Swap old text for new |
| Trim | Remove leading/trailing spaces |
| Pad | Add characters to reach length |
| Upper Case | All capital letters |
| Lower Case | All lowercase |
| Title Case | Capitalize each word |
| Split | Split into columns |
| Concatenate | Join columns |
| Length | Character count |
| Contains | Check if substring exists |
| StartsWith | Check prefix |
| EndsWith | Check suffix |
| Extract Pattern | Extract with regex |
| Count Occurrence | Count substring |
| Remove Whitespace | Clean spaces |
| Reverse | Reverse characters |
| Repeat | Repeat text |
| Encode/Decode URL | URL encoding |
| Slug | URL-friendly text |
| Numerical to Categorical | Numbers to labels |
What's Next?
- [Data Operations Guide](data-operations-guide) – Filter, encode, transpose
- [Date Operations Guide](date-operations-guide) – Date and time transforms
- [Math Operations Guide](math-operations-guide) – Arithmetic and scaling
Related Articles
Data Operations Guide: All 15 Transformations Explained
A complete guide to all 15 data operations: label encode, one-hot encode, filter, transpose, rename, date conversion, concatenate, cross tab, rename factor, impute, grouping, drop duplicates, ignore column, delete missing, and data table view.
Date Operations Guide: All 8 Date and Time Tools
A complete guide to extracting date parts, formatting dates, time deltas, date ranges, holidays, and date differences.
Math Operations Guide: All 12 Numeric Transformations
A complete guide to arithmetic, binning, log transform, power, round/ceil/floor, standardize, normalize, sign, Box-Cox/Yeo-Johnson, and cumulative operations.
Was this helpful?