SELECT TRIM( BOTH 'XX' FROM 'XXplus2net.comXXX')// Output plus2net.comX
Arguments
SELECT TRIM(BOTH 'XX' FROM 'XX.plus2net.com.XXX')// Output .plus2net.com.X
SELECT TRIM(LEADING 'www.' FROM 'www.plus2net.com')// Output plus2net.com
SELECT TRIM(LEADING 'XX' FROM 'XX.plus2net.com.XXX') // Output .plus2net.com.XXX
SELECT TRIM(TRAILING 'com' FROM 'plus2net.com')// Output plus2net.
SELECT TRIM(TRAILING 'XX' FROM 'XX.plus2net.com.XXX') // Output XX.plus2net.com.X
Without using any arguments we can remove blank space from both ends of the string.
SELECT TRIM(' plus2net.com ') // Output is plus2net.com
SELECT TRIM(BOTH 'XX' FROM 'xx.plus2net.com.XXX')// Output xx.plus2net.com.X
To make it case in sensitive function we will use LOWER or UPPER case functions.
SELECT TRIM(BOTH UPPER('XX') FROM UPPER('xx.plus2net.com.XXX')) // Output .PLUS2NET.COM.X
By using LOWER
SELECT TRIM(BOTH LOWER('XX') FROM LOWER('xx.plus2net.com.XXX')) // Output .plus2net.com.x
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
18-12-2023 | |
| SELECT TRIM(BOTH LOWER('X.mcoX') FROM LOWER('xx.plus2net.com.XXX')) // Output plus2net | |