Friday, September 10th, 2010

String/Character Functions – ltrim

The Oracle/PLSQL function ltrim removes all specified characters from the left of a string. It removes every occurrence of specified characters that are leading the string.

Syntax:

LTRIM(string, trim_string)

string is the string from which characters have to be trimmed. trim_string is optional. It is the set of characters that will be removed from the left of the string. The default for this is space.

Example code:

SELECT LTRIM('   author   ') trimmed_name
FROM dual

This returns ‘author ‘

SELECT LTRIM('ABCABCauthorABC', 'ABC') trimmed_name
FROM dual

trimmed_name
————-
authorABC

SELECT LTRIM('124523124author3438', '0123456789') trimmed_name
FROM dual

trimmed_name
————-
author3438

Note: ltrim removes individual occurrences of the number that are leading in the string

Share Article/Example:
  • DotNetKicks
  • DZone
  • StumbleUpon
  • Print
  • Add to favorites
  • Digg
  • del.icio.us
  • Twitter
  • Facebook
  • LinkedIn
  • Posterous
  • Slashdot

Tags: ,

Readers Comments (0)




Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.


Latest Additions

Popular User Submitted Links

1


Hosted & Optimized JS Libraries – Cached Commons

1


Multi-File Uploader & Resizer – Agile Uploader

1


Open source online notebook-to-do-list manager

1


3 tier app design in silverlight using azure & RIA services

1


Polymaps – A JS Library For Image & Vector-Tiled Maps

eXTReMe Tracker