Im trying to do at substring of my RTE content. I wnat the firs xxx characters. No problem. But seeing as the RTE content is html i want to strip the HTML. Got that too. but then i want to display html encoded chracters as normal chracters. that kinda works, but the substring routine cuts the encoded string and, leaves chunks of the encoding... im doing ti likes this
substring html encoded string
Im trying to do at substring of my RTE content. I wnat the firs xxx characters. No problem. But seeing as the RTE content is html i want to strip the HTML. Got that too. but then i want to display html encoded chracters as normal chracters. that kinda works, but the substring routine cuts the encoded string and, leaves chunks of the encoding... im doing ti likes this
ut in cases it leaves me something like this
How do i avoid this?
How about a TruncateAtWord function? https://github.com/warrenbuckley/UmbracoExtensionMethods/blob/master/ExtensionMethods/Strings/StringExtensionMethods.cs
That could be a solution... How would a stupid frontender like me go about using it?
It would be great if that project would become a package one day :-)
Anyhow, within the View, you could do like this:
But wouldnt i need to install those 300+ lines of code that Warren somewhere?
Nope, this is standalone, just using the method as a Razor function
Did it work?
Hi Jeavon
I had to prioritize other matters, so i havent got to test it yet
A couple of years later... It worked perfectly, thanks Jeavon
is working on a reply...