Link to home
Start Free TrialLog in
Avatar of jknj72
jknj72

asked on

Clean String function in SQL Developer

I want to write a function that will look for any variation of the LCF string below and want to replace it with the Last company name in the string, after the last 'LCF' in the string

Example:
Company A LCF COMPANY B L/C/F COMPANY  C

Return: COMPANY C

What to look for:
"LCF", "-LCF", "L/C/F", "L/C/F,", "L.C/F/,", "L/C/F/", "L.C.F", "L.C.F.", "-L/C/F", "L/C/F-", "L-C-F", "LCF/", "L/C/F:", "LCF:", ".L/C/F", "L\C\F", "L\C\F:", ".L\C\F", ".L/C/F", "L C F", "LOST CONTENT FOR", "LOST CONTRACT FOR:"

I would like to pass in
Company A LCF COMPANY B L/C/F COMPANY  C
and get back
COMPANY C

Thanks
Avatar of jknj72
jknj72

ASKER

I don't have a problem finding the variations of LCF and stripping it out, its if there are more then one of them where I am having a problem
ASKER CERTIFIED SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jknj72

ASKER

I will have to try at work in the am. Glad you responded...Thanks for the help again
Avatar of jknj72

ASKER

I forgot I downloaded SQL Developer so I was able to test it at home and it worked like a charm
Avatar of jknj72

ASKER

Great job thanks
Glad to help!

If you find a case where it doesn't, just post a new question and the link to this one and we'll do what we can.
Avatar of jknj72

ASKER

roger that