Collections:
TRIM() - Trimming String
How to trim a string using the TRIM() functions?
✍: FYIcenter.com
TRIM(LEADING|TRAILING|BOTH remstr FROM str) is a MySQL built-in function that
trims a string.
For example:
SELECT TRIM(' dba.FYIcenter.com ');
-- +--------------------------------+
-- | TRIM(' dba.FYIcenter.com ') |
-- +--------------------------------+
-- | dba.FYIcenter.com |
-- +--------------------------------+
Reference information of the TRIM() function:
TRIM(LEADING|TRAILING|BOTH remstr FROM str): modstr
Returns the string str with all remstr prefixes or suffixes removed. If
none of the specifiers BOTH, LEADING, or TRAILING is given, BOTH is
assumed. remstr is optional and, if not specified, spaces are removed.
Arguments, return value and availability:
str: Required. The string that will be extracted from.
LEADING|TRAILING|BOTH remstr FROM: Optional.
Default is BOTH ' ' FROM. Specifies trimming behavior.
remstr: Optional. The substring to be trimmed off.
modstr: Return value. The modified string
Available since MySQL 4.0.
Related MySQL functions:
⇒ UCASE() - Synonym for UPPER()
⇐ TO_BASE64() - Base64 Encoding
2023-11-12, 1130🔥, 0💬
Popular Posts:
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
Where to find answers to frequently asked questions on PHP Connections and Query Execution for MySQL...
How To Fix the INSERT Command Denied Error in MySQL? The reason for getting the "1142: INSERT comman...
How REAL and FLOAT Literal Values Are Rounded in SQL Server Transact-SQL? By definition, FLOAT(n) sh...
How To Generate Random Numbers with the RAND() Function in SQL Server Transact-SQL? Random numbers a...