Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to use the trim function in mysql

Shulou Source: shulou.com Published: 2022-05-31 10:42:37 10月02日 Update

In this article Xiaobian for you to introduce in detail "how to use the trim function in mysql", the content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use the trim function in mysql" can help you solve your doubts.

Description

1. It is used to return the substring after deleting all remstr strings on both sides of the string str, which defaults to a space.

Remstr is optional, and spaces can be deleted if not specified.

2. The string str is returned, where all remstr prefixes and / or suffixes have been deleted.

Grammar

TRIM ([{BOTH | LEADING | TRAILING} [removed_str]] FROM str)

Example

SELECT TRIM ('MySQL string function') AS str1, TRIM ('- 'FROM'-- MySQL string function--) AS str2 Str1 | str2 |-+-+ MySQL string function | MySQL string function | at this point, the article "how to use the trim function in mysql" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, Welcome to the industry information channel.

Tags: Functions characters strings articles content spaces proper prefixes suffixes examples ideas situations new knowledge more steps knowledge knowledge points articles details industry Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple macOS Xiaomi Shulou Tech Info Docker