Removing first and last character

jose11au
jose11au used Ask the Experts™
on
Hi All,

I need your assistance. I would like to remove the fist and last characters from 'VHT56789TYHBG'. Can anyone pls help.


Thanks in advance.

select 'VHT56789TYHBG' from dual
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Glanced up at my screen and thought I had coded the Matrix...  Turns out, I just fell asleep on the keyboard.
Most Valuable Expert 2011
Top Expert 2015
Commented:
SELECT SUBSTR('VHT56789TYHBG', 2, LENGTH('VHT56789TYHBG') - 2) FROM DUAL;

Open in new window

Most Valuable Expert 2011
Top Expert 2012
Commented:
a couple of ways...


select substr(str,2,length(str)-2),
regexp_substr(str,'.(.+).',1,1,null,1)
 from
(select 'VHT56789TYHBG' str from dual )

Author

Commented:
Thanks so much.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial