Home > Database > Oracle > body text

Usage of ltrim function in oracle

下次还敢
Release: 2024-04-30 07:48:11
Original
540 people have browsed it

LTRIM function removes spaces from the left side of a string, and returns the original string if there are no spaces in the string. 1. Syntax: LTRIM(string). 2. LTRIM only removes spaces on the left; RTRIM only removes spaces on the right; TRIM removes spaces on both sides. 3. LTRIM returns NULL for NULL values.

Usage of ltrim function in oracle

Usage of LTRIM function in Oracle

LTRIM function is used to remove spaces from the left side of a string .

Syntax

<code>LTRIM(string)</code>
Copy after login

Where:

  • string is the string to be modified.

Usage

The LTRIM function accepts a string argument and returns the string with all spaces on the left trimmed. If there are no spaces in the string, the original string is returned.

Example

<code>SELECT LTRIM('   Hello World   ') FROM dual;

输出:

Hello World</code>
Copy after login

In this example, the LTRIM function removes all spaces from the left side of the string, producing the result "Hello World".

LTRIM's relationship to RTRIM and TRIM

  • LTRIM removes spaces only from the left side of the string.
  • RTRIM removes spaces from the right side of a string only.
  • TRIM Removes spaces from both sides of a string.

Note

  • The LTRIM function returns NULL for NULL values.
  • If the parameter is not a string, an error will be generated.

The above is the detailed content of Usage of ltrim function in oracle. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!