How to remove the html tags without using HTML packages

78 views
Skip to first unread message

mahantappa b k

unread,
Feb 28, 2020, 5:34:51 AM2/28/20
to Flutter Development (flutter-dev)
Below is my paragraph which is having html tags and I want to remove those without using html packages in flutter

<p style="margin-bottom:13px"><span style="font-size:11pt"><span style="line-height:115%"><span style="font-family:Calibri,sans-serif"><span style="font-size:12.0pt"><span style="line-height:115%"><span style="font-family:&quot;Tunga&quot;,&quot;sans-serif&quot;">ಈಗ ಜಗತ್ತಿನಲ್ಲೇ ಅತ್ಯಧಿಕ ಹಾಲು ಉತ್ಪಾದಿಸುವ ದೇಶ ಭಾರತ. ೨೦೧೭-೧೮ರಲ್ಲಿ ಯುರೋಪಿಯನ್ ಒಕ್ಕೂಟಕ್ಕಿಂತಲೂ ಹೆಚ್ಚು ಹಾಲು ಉತ್ಪಾದಿಸುವ ಮೂಲಕ ಮೊದಲ ಸ್ಥಾನಕ್ಕೇರಿದೆ.</span></span></span></span></span></span></p>

Karthik Ponnam

unread,
Feb 28, 2020, 5:55:57 AM2/28/20
to Flutter Development (flutter-dev)
You can use regex to replace complete html tags with empty string

regexr.com/4vaqj

Larpoux

unread,
Feb 28, 2020, 5:59:30 AM2/28/20
to Flutter Development (flutter-dev), Karthik Ponnam
I use this expression :

title = title.replaceAll( RegExp( r'</?[a-z]*/?>' ), '' );
On 28 Feb 2020 at 11:56 +0100, Karthik Ponnam <ponnamk...@gmail.com>, wrote:
You can use regex to replace complete html tags with empty string

regexr.com/4vaqj

--
You received this message because you are subscribed to the Google Groups "Flutter Development (flutter-dev)" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/flutter-dev/90722924-1897-45f7-94c5-3b8710dbabcc%40googlegroups.com.

mahantappa b k

unread,
Feb 28, 2020, 6:15:52 AM2/28/20
to Flutter Development (flutter-dev)
Thank you it worked.
Reply all
Reply to author
Forward
0 new messages