Activity Forums Salesforce® Discussions How to read text between tags in Salesforce?

  • Deepak

    Member
    June 3, 2020 at 8:51 am

    You have to use Java regex to extract text between tags.
    Code snippet for the following is:
    final Pattern pattern = Pattern.compile("<tag>(.+?)</tag>");
    final Matcher matcher = pattern.matcher("<tag>String I want to extract</tag>");
    matcher.find();
    System.out.println(matcher.group(1)); // Prints String which you want to extract

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos