API Reference
Class
EmailString
Generic string helpers for email rendering.
Inheritance
- Object
- EmailString
Methods
public static String Truncate(String text, Int32 max, String ellipsis = "…") #Returns:
StringReturns a truncated version of the input text when it exceeds max characters. Adds ellipsis (default: …) when truncation occurs.
Parameters
- text System.String
- Input text (may be null).
- max System.Int32
- Maximum allowed characters (must be > 0).
- ellipsis System.String = "…"
- Ellipsis string to append when truncated (default: …).
public static String TruncateMiddle(String text, Int32 head, Int32 tail, String ellipsis = "…") #Returns:
StringReturns a middle-truncated version of the input text when it exceeds head + tail characters. Keeps head chars from the start and tail chars from the end, inserting ellipsis between them.
Parameters
- text System.String
- head System.Int32
- tail System.Int32
- ellipsis System.String = "…"