JK
Search Results for

    Show / Hide Table of Contents

    Class StringTruncater

    Class which truncates strings.

    Inheritance
    System.Object
    StringTruncater
    Inherited Members
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: JK.Common.Text
    Assembly: JK.Common.dll
    Syntax
    public class StringTruncater

    Constructors

    | Improve this Doc View Source

    StringTruncater(String)

    Initializes a new instance of the StringTruncater class.

    Declaration
    public StringTruncater(string originalText)
    Parameters
    Type Name Description
    System.String originalText

    Text to be truncated.

    | Improve this Doc View Source

    StringTruncater(String, String)

    Initializes a new instance of the StringTruncater class.

    Declaration
    public StringTruncater(string originalText, string indicator)
    Parameters
    Type Name Description
    System.String originalText

    Text to be truncated.

    System.String indicator

    Indicator to be placed within the truncated text to indicate that a truncation has taken place.

    Properties

    | Improve this Doc View Source

    Indicator

    Gets or sets the indicator to concatenate to the end of truncated text. Ex: '...'

    Declaration
    public string Indicator { get; set; }
    Property Value
    Type Description
    System.String

    Methods

    | Improve this Doc View Source

    TruncateToLength(in Int32)

    Truncates the original text to a given length.

    Declaration
    public string TruncateToLength(in int length)
    Parameters
    Type Name Description
    System.Int32 length

    Length of string to output.

    Returns
    Type Description
    System.String

    Original text truncated to given length.

    Extension Methods

    ClassExtensions.IsNull<T>(T)
    ClassExtensions.IsNotNull<T>(T)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © Jeremy Knight. Generated with DocFX