Code Reference

String Functions

SQL · Methods reference

SQL · Methods reference


📋 Overview

String manipulation — names vary slightly by dialect.

🔧 Methods

Standard / common

FunctionDescription
CONCAT(a, b, …) / `
LENGTH / CHAR_LENGTHCharacter length
LOWER / UPPERCase conversion
TRIM / LTRIM / RTRIMRemove whitespace/chars
SUBSTRING(str FROM start FOR len)Extract substring
REPLACE(str, from, to)Replace occurrences
POSITION(sub IN str) / INSTRFind substring index
LPAD / RPADPad to length
SPLIT_PART(str, delim, n) (PG)Nth split segment
REGEXP_REPLACE / REGEXP_MATCHES (PG)Regex ops

💡 Examples

See parent topic notes for runnable snippets; this page is the complete method index.

⚠️ Pitfalls

  • Mutating methods return None in Python — do not chain sort() / reverse() expecting a new list.
  • Default JS sort() compares strings — pass (a,b) => a-b for numbers.
  • SQL function names differ by dialect — verify Postgres vs MySQL docs.
  • Django QuerySet.update() skips save() signals and auto auto_now fields on models.

On this page