• Meehir Mene
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
Hi all, I have a controller that it's supposed to parse Subject line of an Email and extract a certain set of stings. For example, If the Subject line is [112233-notification number 22] - [Customer Support], I want to be able to extract only the "112233" portion of the text. I use the code below to find the index of "[" & index of last "-". String extract = c.Subject.substring(c.Subject.indexOf('[')+1, c.Subject.LastIndexOf('-')); However, I received "112233-notification number 22]" as my extract string. How should I go about locating only the "112233" part? My method needs to smart enough to locate only the integer between [ & - (within the closed [ ]). Appreciate your inputs.
  • June 06, 2011
  • Like
  • 0