In Oracle, the RTRIM()
function allows you to trim the right part of a string. By default, it trims white space, but you can optionally specify a different character or characters to trim.
Tag: string functions
Replace Multiple Characters in a String in SQL Server (T-SQL)
In SQL Server, the REPLACE()
function enables us to replace a string with another string. But what if you want to replace a list of characters with another list of characters?
The TRANSLATE()
function might help.
MariaDB LTRIM() vs LTRIM_ORACLE(): What’s the Difference?
MariaDB has an LTRIM()
function and a LTRIM_ORACLE()
function. Both functions do essentially the same thing. But there is a minor difference.
MariaDB String Functions (Full List)
This article contains a full list of built-in MariaDB string functions and operators.
Continue readingDifference Between TRIM() and TRIM_ORACLE() in MariaDB
MariaDB has a TRIM()
function and a TRIM_ORACLE()
function. Both functions do essentially the same thing. But there is a minor difference.
How TO_CHAR() Works in MariaDB
In MariaDB, TO_CHAR()
is a built-in string function that converts a date/time expression to a string.
The expression can be a date, datetime, time, or timestamp value.
This function was introduced in MariaDB 10.6.1 to enhance Oracle compatibility.
Continue readingReplace a String with another String in SQL Server (T-SQL)
In SQL Server you can use the REPLACE()
function to replace all occurrences of a string with another string.
The function accepts three arguments; the string that contains the string to be replaced, the string to be replaced, and the string to replace it.
Continue readingInsert Characters into the Middle of a String in SQL Server (T-SQL)
SQL Server provides the STUFF()
function that enables you to insert a string inside another string.
The function also allows you to specify the number of characters (if any) to delete from the original string in order to fit the new string.
Continue readingHow REGEXP_REPLACE() Works in MariaDB
In MariaDB, the REGEXP_REPLACE()
function replaces occurrences of the substring within a string that matches the given regular expression pattern.
The whole string is returned along with the replacements.
If there’s no match (i.e. the input string doesn’t contain the substring), the the whole string is returned unchanged.
Continue readingHow REGEXP_SUBSTR() Works in MariaDB
In MariaDB, the REGEXP_SUBSTR()
function returns the substring that matches the given regular expression pattern.
If there’s no match (i.e. the input string doesn’t contain the substring), the result is an empty string.
Continue reading