| | | 1 | | // ----------------------------------------------------------------------- |
| | | 2 | | // <copyright file="Truncator.cs" company="Stéphane ANDRE"> |
| | | 3 | | // Copyright (c) Stéphane ANDRE. All rights reserved. |
| | | 4 | | // </copyright> |
| | | 5 | | // ----------------------------------------------------------------------- |
| | | 6 | | |
| | | 7 | | namespace MyNet.Text.Truncation; |
| | | 8 | | |
| | | 9 | | /// <summary> |
| | | 10 | | /// Provides predefined text truncators for common truncation scenarios, such as truncating to a fixed length, a fixed n |
| | | 11 | | /// </summary> |
| | | 12 | | public static class Truncator |
| | | 13 | | { |
| | | 14 | | /// <summary> |
| | | 15 | | /// Gets or sets a truncator that truncates text to a fixed length, optionally adding a truncation string (e.g. elli |
| | | 16 | | /// </summary> |
| | 0 | 17 | | public static FixedLengthTextTruncator FixedLength { get; set; } = new(new() { Length = 100, TruncationString = "... |
| | | 18 | | |
| | | 19 | | /// <summary> |
| | | 20 | | /// Gets or sets a truncator that truncates text to a fixed number of characters, optionally adding a truncation str |
| | | 21 | | /// </summary> |
| | 0 | 22 | | public static FixedNumberOfCharactersTextTruncator FixedNumberOfCharacters { get; set; } = new(new() { Length = 100, |
| | | 23 | | |
| | | 24 | | /// <summary> |
| | | 25 | | /// Gets or sets a truncator that truncates text to a fixed number of words, optionally adding a truncation string ( |
| | | 26 | | /// </summary> |
| | 0 | 27 | | public static FixedNumberOfWordsTextTruncator FixedNumberOfWords { get; set; } = new(new() { Length = 100, Truncatio |
| | | 28 | | } |
| | | 29 | | |