-
I have a string:
c:\temp\sak\mat.exe
I am trying to get the following string:
mat.exe
In short anything after the last \.
Is there any way to get this as there are no left or right functions ( atleast I did not find them)
The length of string is not fixed and also the .extension, path.
Any help please
Thanks
Sonali
Sonali
-
How about using substring counting the no. of characters from left and pick last characters (mat.exe). Just see the syntax. you might be interested in.
-
INSTR function can be used to find a n-th occurence of a particular character either forwards if n is positive or *backwards* if n is negative.
In your example, you would use something like this:
SELECT SUBSTR( 'c:\temp\sak\mat.exe', INSTR('c:\temp\sak\mat.exe', '\', -1)+1)) FROM dual;
HTH,
Jurij Modic
ASCII a stupid question, get a stupid ANSI
24 hours in a day .... 24 beer in a case .... coincidence?
-
Looks like JModic has answers to all/any questions.
Not to say I tried all this but did not know -ve and +ve
use in Instr.
Thanks again
Sonali
Sonali
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|