I've a task to print substring from a string based on the occurence of slash '/' position in a string .Below i'm trying to show you one sample example how i want to get .
Declare @My_string = 'abc/def gh /ijk l/m/no p/qr
From the above string i want to print the substring value based on the position of slash occourence.
For Example: Sometimes i was asked to print the substring after the 2nd occourence of slah then i've to display ijk l
and Sometimes i was asked to print the substring after the 3rd occourence then m
should display if it is 1st then def gh
vice versa .There is no specific occourence position it may vary based on need .How can i achieve it .Any help will be very thankful
Note: I want to achieve without using function .i know that it can be done by using split function .Is that possible to get without using it