• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

Split the string and find substrings index in oracle

 
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a string like this TESTAPP_B_ABCD_JP_0_FILENAME I want the index of "ABCD" I have tried


It returns 10..It means it gives me index counting the characters

I want the output as 3 (Splitting the string TESTAPP(1),B(2),ABCD(3)).

Please guide.
 
author & internet detective
Posts: 42160
937
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You don't want the index then. You want a combination of three things:

1) The substring TESTAPP_B_ABCD
2) The number of split strings or the number of underscores +1

Do you know how to do either or both of these independently? (You should be able to figure out substring)
 
reply
    Bookmark Topic Watch Topic
  • New Topic