Oracle String Functions

25 functions

CONCATCONCAT(s1, s2)

Concatenates two strings (equivalent to the || operator).

SUBSTRSUBSTR(str, pos [, len])

Extracts a substring from a specified position.

SUBSTRBSUBSTRB(str, pos [, len])

Extracts a substring by byte position.

LENGTHLENGTH(str)

Returns the character count of a string.

LENGTHBLENGTHB(str)

Returns the byte length of a string.

UPPERUPPER(str)

Converts a string to uppercase.

LOWERLOWER(str)

Converts a string to lowercase.

TRIMTRIM([{LEADING|TRAILING|BOTH} c FROM] str)

Removes leading and trailing spaces (or specified characters).

LTRIMLTRIM(str [, chars])

Removes specified characters from the left side.

RTRIMRTRIM(str [, chars])

Removes specified characters from the right side.

REPLACEREPLACE(str, from [, to])

Replaces occurrences of a substring.

INSTRINSTR(str, substr [, pos [, n]])

Returns the position of the nth occurrence of a substring.

LPADLPAD(str, n [, pad])

Left-pads a string to a specified length.

RPADRPAD(str, n [, pad])

Right-pads a string to a specified length.

INITCAPINITCAP(str)

Converts the first letter of each word to uppercase.

TRANSLATETRANSLATE(str, from, to)

Performs character-by-character substitution.

TO_CHARTO_CHAR(expr [, fmt])

Converts a value to a string.

REGEXP_REPLACEREGEXP_REPLACE(src, pat [, rep ...])

Replaces matches of a regular expression pattern.

REGEXP_SUBSTRREGEXP_SUBSTR(str, pat [, ...])

Returns the matched substring of a regular expression.

REGEXP_INSTRREGEXP_INSTR(str, pat [, ...])

Returns the position of a regular expression match.

DECODEDECODE(expr, s1, r1 [, s2, r2 ...] [, default])

Conditional substitution similar to CASE.

NVLNVL(expr, replacement)

Returns a replacement value if the expression is NULL.

NVL2NVL2(expr, v_notnull, v_null)

Returns different values depending on whether the expression is NULL.

ASCIIASCII(str)

Returns the ASCII code of the first character.

CHRCHR(n)

Converts an ASCII code to a character.