Returns a string that has the max amount of characters of the source string. If the string is shorter than the max length the entire string is returned. If the string is longer it's truncated. If empty the original value is returned (null or string.Empty) If the startPosition is greater than the length of the string null is returned
public static string GetMaxCharacters(string s, int maxCharacters, int startPosition)
Parameters
s
source string to work on
maxCharacters
Maximum number of characters to return
startPosition
Optional start position. If not specified uses entire string (0)
See also:
Class StringUtils© West Wind Technologies, 1996-2024 • Updated: 06/29/24
Comment or report problem with topic