Home > Database > Mysql Tutorial > What is the purpose of the MySQL TRIM() function?

What is the purpose of the MySQL TRIM() function?

WBOY
Release: 2023-09-09 08:25:10
forward
1178 people have browsed it

MySQL TRIM() 函数的用途是什么?

MySQL TRIM() function is used to remove a specific suffix, prefix, or both from a string. The working principle of the TRIM() function can be understood through its syntax. side prefix.

The LEADING parameter indicates only the leading prefix to be removed.

TRAILING parameter means to remove only the trailing prefix.

    Str_to_remove is a parameter indicating the string we want to remove from the string.
  • Str_to_remove is a parameter indicating the string we want to remove from the string. >
  • The string parameter indicates the string from which the prefix must be removed.
  • Example
  • Here, the
  • BOTH parameter indicates that both the left and right prefixes are to be removed from the string.

The LEADING parameter indicates that only the prefix is ​​deleted.

TRAILING parameter means to delete only the suffix.

    Str_to_remove is the string parameter to be removed from the string.
  • The String parameter represents the string from which the prefix is ​​to be removed.
  • Example
  • TRIM([{BOTH | LEADING | TRAILING} [str_to_remove] FROM] string)
    Copy after login

The above is the detailed content of What is the purpose of the MySQL TRIM() function?. For more information, please follow other related articles on the PHP Chinese website!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template