SQL - SUBSTRING() / SUBSTR()
The SUBSTRING() function extracts a portion of a string based on starting position and length. Different database systems implement variations:
Read more →The SUBSTRING() function extracts a portion of a string based on starting position and length. Different database systems implement variations:
Read more →String manipulation is one of those tasks that seems simple until you’re knee-deep in edge cases. The str_sub() function from the stringr package handles substring extraction and replacement with a…
Python implements substring extraction through slice notation using square brackets. The fundamental syntax is string[start:stop], where start is inclusive and stop is exclusive.
String manipulation is fundamental to data engineering workflows, especially when dealing with raw data that requires cleaning, parsing, or transformation. PySpark’s DataFrame API provides a…
Read more →The str.slice() method operates on pandas Series containing string data, extracting substrings based on positional indices. Unlike Python’s native string slicing, this method vectorizes the…
The longest palindromic substring problem asks you to find the longest contiguous sequence of characters within a string that reads the same forwards and backwards. Given ‘babad’, valid answers…
Read more →The Longest Repeated Substring (LRS) problem asks a deceptively simple question: given a string, find the longest substring that appears at least twice. The substrings can overlap, which makes the…
Read more →The longest common substring problem asks a straightforward question: given two strings, what’s the longest contiguous sequence of characters that appears in both? This differs fundamentally from the…
Read more →MySQL’s SUBSTRING function extracts a portion of a string based on position and length parameters. Whether you’re parsing legacy data formats, cleaning up user input, or transforming display values,…
Read more →Bash provides robust built-in string manipulation capabilities that many developers overlook in favor of external tools. While sed, awk, and grep are powerful, spawning external processes for…