Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
The moose likes Oracle/OAS and the fly likes substr in oracle Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "substr in oracle" Watch "substr in oracle" New topic

substr in oracle

Vallaru smitha
Ranch Hand

Joined: Aug 19, 2008
Posts: 87


Can anyone please help to extract yahoo from above string.

Fatih Keles
Ranch Hand

Joined: Sep 01, 2005
Posts: 182
You can use a combination of substr and instr. Something like this.

But you may need to improve to handle repeating '.'
Christophe Verré

Joined: Nov 24, 2005
Posts: 14687

Note that Oracle supports regular expressions (REGEXP_LIKE), so if you can come up with a regular expression to extract that part, you'll probably be able to use it with Oracle.

[My Blog]
All roads lead to JavaRanch
jQuery in Action, 2nd edition
subject: substr in oracle
Similar Threads
NX: Reading from the DB
TOMCAT Environmental Variables
Weird error
design the Java swing with dynamic creation of JTextfield,JLabel,Jcombobox
SCJP 1.5 review - not a so good test?