2 Replies Latest reply: Jan 9, 2008 7:02 AM by 807603 RSS

    String method to return subString based on "tags"

    807603
      Hi,

      Is there a simple method of String or another class which will do the following:
      String myStr = "Hello this a string with [myTag] and I want just this bit [/myTag]";
      String subStr = myStr.someMethod("[myTag]" ,"[/myTag]").toString();
      giving subStr = " and I want just this bit "

      In other words rather than the String.subString(int x, int y) method which does the above but based on char indexes is there a method which will do it based on text...

      I realize this is kinda like XML parsing but don't want to go down that route.

      Thanks in advance...
      Hugh