Метод | Описание | |
---|---|---|
AnOrA ( this instance, bool properCase = false ) : string |
Returns the appropriate 'An' or 'A' prefix for the given string. The given string is not included in the return text.
|
|
IsNothing ( this instance ) : bool |
Returns true if the string is null, whitespace or empty. Equivelant to IsNullOrWhiteSpace
|
|
IsSomething ( this instance ) : bool |
Returns true if the string is not null, not whitespace, and not empty. The direct opporsite of IsNothing
|
|
SplitLines ( this instance, int numberOfLines ) : string[] |
An extension to the string.Split(char[]) method. This method splits at new line characters, trims off trailing whitespace, and returns the specified number of lines.
|
|
TrimEndSafely ( this instance ) : string |
Trims the end of a string safely. If the string is null, null is returned.
|
|
Truncate ( this instance, int truncateToLength, bool useEllipses = false ) : string |
Truncates the right of a string to the specified length, but only if it exceeds that length. Optionally the returned string can include ellipses.
|
|
TruncateLeft ( this instance, int truncateToLength, bool useEllipses = false ) : string |
Truncates the left of a string to the specified length, but only if it exceeds that length. Optionally the returned string can include ellipses.
|
public static AnOrA ( this instance, bool properCase = false ) : string | ||
instance | this | The string to determine the prefix for. |
properCase | bool | A boolean to indicate if the prefix should be proper-cased or not. |
Результат | string |
public static IsNothing ( this instance ) : bool | ||
instance | this | |
Результат | bool |
public static IsSomething ( this instance ) : bool | ||
instance | this | |
Результат | bool |
public static SplitLines ( this instance, int numberOfLines ) : string[] | ||
instance | this | |
numberOfLines | int | |
Результат | string[] |
public static TrimEndSafely ( this instance ) : string | ||
instance | this | |
Результат | string |
public static Truncate ( this instance, int truncateToLength, bool useEllipses = false ) : string | ||
instance | this | |
truncateToLength | int | |
useEllipses | bool | |
Результат | string |
public static TruncateLeft ( this instance, int truncateToLength, bool useEllipses = false ) : string | ||
instance | this | |
truncateToLength | int | |
useEllipses | bool | |
Результат | string |