I want to split a gridview row on an html tag. How can i do this preferably in C#??
e.row.cells[1].Text.Split("htmltag")
Yes. Use the overload
String.Split(String[], StringSplitOptions)
or
String.Split(String[], int, StringSplitOptions)
Example:
var split = e.row.cells[1].Text.Split( new[] { "</b>" }, StringSplitOptions.RemoveEmptyEntries );
But do heed StrixVaria's comment above. Parsing HTML is nasty so unless you're an expert offload that work to someone else.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With