Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Remove HTML tag

Former Member
0 Likes
1,591

Hi all,

Given a string consist of string encoded in HTML. Any standard Function Module to remove the HTML code?

eg, Change "<HTML><B>Sample Text</B></HTML>" to "Sample Text"

Any suggestion/comments are welcome!

Thanks

Best regards,

Prakesh.

3 REPLIES 3
Read only

venkat_o
Active Contributor
0 Likes
575

Hi Gupta, <li>Use HRDSYS_CONVERT_FROM_HTML function module. Thanks Venkat.O

Read only

Former Member
0 Likes
575

Hi Prakesh,

To remove the HTML tags from a string, use the following sample formula:

whileprintingrecords;

stringvar sample := {table.stringfield};

numbervar counter := ubound(split(sample,"<"))-1;

numbervar i;

for i := 1 to counter do(

numbervar openbracket := instr(sample,"<");

numbervar closebracket := instr(sample,">");

sample := left(sample,openbracket-1) & mid(sample,closebracket+1));

sample;

====================

NOTE:

This formula removes all text between the '<' and '>' characters. Adjustments may be required if only some tags should be removed, or if the '<' or '>' characters appear by themselves in the original string.

====================

Thanks & Regards,

Sarita Singh Rathour

Edited by: Sarita Rathour on Jul 24, 2009 6:06 AM

Edited by: Sarita Rathour on Jul 24, 2009 6:07 AM

Edited by: Sarita Rathour on Jul 24, 2009 6:09 AM

Read only

Former Member
0 Likes
575

use fm sotr_tags_remove_from_string