Method BoundedString
- Namespace
- WhalesSecret.TradeScriptLib.Logging
- Assembly
- WhalesSecret.TradeScriptLib.dll
BoundedString(string?, int, bool)
Extension of string class to return at most maxLength
characters of the string for formatting purposes.
public static string BoundedString(this string? s, int maxLength = 1024, bool useEllipses = true)
Parameters
s
stringString instance.
maxLength
intMaximum acceptable length of a result. DefaultBoundedStringMaxLength by default.
useEllipses
booltrue
to add ellipses at the end of the string is shortened,false
otherwise.
Returns
- string
String instance itself or a new string instance that is
maxLength
characters long.