当前位置:网站首页>Oracle/PLSQL: Rtrim Function
Oracle/PLSQL: Rtrim Function
2022-06-27 01:45:00 【yuanlnet】
In Oracle/PLSQL, the rtrim function removes all specified characters from the right-hand side of a string.
Syntax
The syntax for the rtrim function is:
rtrim( string1, [ trim_string ] )
string1 is the string to trim the characters from the right-hand side.
trim_string is the string that will be removed from the right-hand side of string1. If this parameter is omitted, the rtrim function will remove all trailing spaces from string1.
Applies To
- Oracle 11g, Oracle 10g, Oracle 9i, Oracle 8i
For Example
rtrim('tech '); | would return 'tech' |
rtrim('tech ', ' '); | would return 'tech' |
rtrim('123000', '0'); | would return '123' |
rtrim('Tech123123', '123'); | would return 'Tech' |
rtrim('123Tech123', '123'); | would return '123Tech' |
rtrim('Techxyxzyyy', 'xyz'); | would return 'Tech' |
rtrim('Tech6372', '0123456789'); | would return 'Tech' |
The rtrim function may appear to remove patterns, but this is not the case as demonstrated in the following example.
rtrim('Techxyxxyzyyyxx', 'xyz'); | would return 'Tech' |
It actually removes the individual occurrences of 'x', 'y', and 'z', as opposed to the pattern of 'xyz'.
The rtrim function can also be used to remove all trailing numbers as demonstrated in the next example.
rtrim('Tech6372', '0123456789'); | would return 'Tech' |
In this example, every number combination from 0 to 9 has been listed in the trim_string parameter. By doing this, it does not matter the order that the numbers appear in string1, all trailing numbers will be removed by the rtrim function.
边栏推荐
猜你喜欢

架构实战营模块五作业

Systematic analysis of social networks using Networkx: Facebook network analysis case

Daily question brushing record (V)

“所有专业都在劝退”,对大学生最友好的竟然是它?

SystemVerilog仿真速率提升

使用NetworkX对社交网络进行系统的分析:Facebook网络分析案例

持续交付-Blue Ocean 应用

Amazon ElastiCache 飞速搭建缓存服务集群,这才叫快

接口测试框架实战(一) | Requests 与接口请求构造

简单学习GoogleColab的入门级概念
随机推荐
TopoLVM: 基于LVM的Kubernetes本地持久化方案,容量感知,动态创建PV,轻松使用本地磁盘
Due to the invalidation of the prospectus of bori technology, CICC has stopped providing guidance to it and abandoned the listing on the Hong Kong stock exchange?
Reading a book in idea is too much!
XSS attack notes (Part 1)
消费者追捧iPhone,在于它的性价比超越国产手机
“所有专业都在劝退”,对大学生最友好的竟然是它?
Kept to implement redis autofailover (redisha) 15
每日刷题记录 (五)
JVM 的指针压缩
[the path of system analyst] Chapter 6: duplicate demand engineering (case paper)
cookie,sessionstorage,localstorage区别
在 IDEA 里看个书很过分嘛!
Custom class loader encrypts and decrypts classes
Topolvm: kubernetes local persistence scheme based on LVM, capacity aware, dynamically create PV, and easily use local disk
Tsinghua & Zhiyuan | cogview2: faster and better text image generation model
Oracle/PLSQL: Rtrim Function
Oracle/PLSQL: Soundex Function
Oracle/PLSQL: Cast Function
Oracle/PLSQL: Lpad Function
Systematic analysis of social networks using Networkx: Facebook network analysis case