Use of Trim function in Oracle _ static function

Source: Internet
Author: User

In Oracle/plsql, the trim function removes all specified characters either from the beginning or the ending of a string.

The syntax for the TRIM function is:
Trim ([Leading|trailing|both[trim_character]] string1)

Leading-remove trim_string from the front of string1.

Trailing-remove trim_string from the end of string1.

Both-remove trim_string from the front and end of string1.

If None of these are chosen (ie:leading, trailing, both), the TRIM function would remove trim_string from both the front a nd end of string1.

Trim_character is the character that would be removed from string1. If This parameter is omitted, the trim function would remove all leading and trailing spaces from string1.

String1 is the string to trim.

For example:
Trim (' tech ') would return ' tech '
Trim (' from ' tech ') would return ' tech '
Trim (Leading ' 0 ' 000123 ') would return ' 123 '
Trim (trailing ' 1 ' Tech1 ') would return ' Tech '
Trim (both ' 1 ' 123tech111 ') would return ' 23Tech '

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.