TextHelperLimitLength Method (String, Int32, String, Boolean, CutTextEnum) |
Limits the string length.
Namespace: CMS.HelpersAssembly: CMS.Helpers (in CMS.Helpers.dll) Version: 12.0.0
Syntax public static string LimitLength(
string text,
int maxLength,
string padString = "...",
bool wholeWords = false,
CutTextEnum cutLocation = CutTextEnum.End
)
Parameters
- text
- Type: SystemString
Text to trim - maxLength
- Type: SystemInt32
Max length - padString (Optional)
- Type: SystemString
Trim character - wholeWords (Optional)
- Type: SystemBoolean
If true, the text won't be cut in the middle of the word - cutLocation (Optional)
- Type: CMS.HelpersCutTextEnum
Location in the text where the cut of extra text occurs
Return Value
Type:
StringSee Also