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 tags in text

Former Member
0 Likes
1,412

Hi,

I have to read some text from a text editor, that can be formatted for example with Bold, which means that when I execute the function to read its content, it returns something like this:

".

Do you know how can I remove these HTML tags from the text?

Thanks in advance.

Regards,

Sónia Gonçalves

Hi,

I have to read some text from a text editor, that can be formatted for example with Bold, which means that when I execute the function to read its content, it returns something like this:

".

Do you know how can I remove these HTML tags from the text?

Thanks in advance.

Regards,

Sónia Gonçalves

3 REPLIES 3
Read only

Former Member
0 Likes
733

Hi,

Something like this should do the trick.

report  ztag.

data: v_data type char30 value '<H>blablabla</H>'.

if v_data(1) = '<' and 
  v_data cs '>'.
* Remove the HTML opening header
  shift v_data left up to '>'.
  shift v_data left.
* Remove the HTML closing header
  shift v_data right up to '<'.
  shift v_data right.
  shift v_data left deleting leading space.
endif.

write: / v_data.

Regards,

Darren

Read only

0 Likes
733

Hi,

I discovered the function "CONVERT_ITF_TO_ASCII" that removes those characters.

Thanks anyway.

Regards,

Sónia Gonçalves

Read only

Former Member
0 Likes
733

See if FM SOTR_TAGS_REMOVE_FROM_STRING is what you want.

Rob