TruncateString()
Helpful String Extensions

Jan 22

Introduction

Sitefinity offers some help string extensions. The best being TruncateString() allowing you to format those short summary sections on your pages.

Something that I have found helpful over the last year is some included extensions that Sitefinity provides. You can find them in the Telerik.Sitefinity.dll under System. There is a range of helpful string functions such as Capitalise the first letter and format words into Camel or Pascal case.

TruncateString()

The most useful extension of the group has to be TrunacteString(). It allows you to specify the max length of your string as well as have it formatted to a few options.

  • None
  • Finish Word
  • Allow Last Word To Go Over Max Length
  • Include Ellipsis

I hope it helps you out.


Darrin Robertson - Sitefinity Developer

Thanks for reading and feel free to comment - Darrin Robertson

If I was really helpful and you would buy me a coffee if you could, yay! You can.


Leave a comment
Load more comments

Make a Comment

recapcha code