Remove Html tags


Pavel Mencl
 

Hi,
I need to remove all Html tags from a text field, any ideas, please?
Thanks
Pavel


Todd Baremore
 

Pavel,
Try this.  My test string does not include a link so you may need to make some adjustments.  This also assumes that there are no "<" or ">" in the actual data.



Todd
On 1/6/2023 3:10 AM, Pavel Mencl wrote:

Hi,
I need to remove all Html tags from a text field, any ideas, please?
Thanks
Pavel


Pavel Mencl
 

Thanks Tood, I'll look into it, good food for thought.
In the meantime I've found this function in my Test&Play folder:
DotNet.System.Text.RegularExpressions.Regex.Replace(TextVariable,'<[^>]*>','')
I'm not well-versed in the regex area (shame on me) but it seems to work reasonable well too.
Pavel


Todd Baremore
 

That is much cleaner than my approach. Thanks for sharing it.
Todd
On 1/6/2023 9:02 AM, Pavel Mencl wrote:

Thanks Tood, I'll look into it, good food for thought.
In the meantime I've found this function in my Test&Play folder:
DotNet.System.Text.RegularExpressions.Regex.Replace(TextVariable,'<[^>]*>','')
I'm not well-versed in the regex area (shame on me) but it seems to work reasonable well too.
Pavel