Skip to content
Taiizor edited this page Mar 1, 2023 · 3 revisions

TextExtension Class


The TextExtension class contains extension methods related to text operations.

Properties

Property Description
CutSymbol The symbol to use when cutting a string. Default value is '...'
CutMethod The text truncation method to use. Default value is ETT.End (cut from end)
Length The length of the string to be returned. Default value is 100.
ListSymbol The symbol to use when generating a list of strings. Default value is '-'.
List The number of items to generate in a list. Default value is 5.
Word The length of the words to generate. Default value is 10.

Methods

Method Description Parameters Return Type
Cut Cuts a string to a specified length and adds a symbol to the end of the string.
  • Text (optional): The string to cut. Default value is the Text property.
  • Length (optional): The length to cut the string to. Default value is the Length property.
  • Symbol (optional): The symbol to use at the end of the cut string. Default value is the CutSymbol property.
  • Method (optional): The text truncation method to use. Default value is the CutMethod property.
string
CutAsync Cuts a string to a specified length and adds a symbol to the end of the string. This method runs asynchronously.
  • Text (optional): The string to cut. Default value is the Text property.
  • Length (optional): The length to cut the string to. Default value is the Length property.
  • Symbol (optional): The symbol to use at the end of the cut string. Default value is the CutSymbol property.
  • Method (optional): The text truncation method to use. Default value is the CutMethod property.
Task<string>
Text Generates a random string of a specified length.
  • Length (optional): The length of the string to generate. Default value is the Length property.
string
TextAsync Generates a random string of a specified length. This method runs asynchronously.
  • Length (optional): The length of the string to generate. Default value is the Length property.
Task
List Generates a list of random strings.
  • Length (optional): The length of each string in the list. Default value is the Length property.
  • Count (optional): The number of strings to generate. Default value is the List property.
  • Symbol (optional): The symbol to use when separating the strings in the list. Default value is the ListSymbol property.
List
ListAsync Generates a list of random strings. This method runs asynchronously.
  • Length (optional): The length of each string in the list. Default value is the Length property.
  • Count (optional): The number of strings to generate. Default value is the List property.
  • Symbol (optional): The symbol to use when separating the strings in the list. Default value is the ListSymbol property.
Clone this wiki locally