Click or drag to resize

StringExtensionsFirst Method

Overload List
  NameDescription
Public methodStatic memberFirst(String)
Gets the first character of the string. The returned string always will be zero or one character long, and never null. The original string may be null or empty. If the original string is null or empty, string.Empty will be returned otherwise the first character of the string will be returned.
Public methodStatic memberFirst(String, Int32)
Gets the first n characters of the string. The returned string always will be the specified length or shorter, and never null. The original string may be null or empty. If the original string is null or shorter than requested, the returned string will be returned (or string.Empty if null). If the original string is longer than requested, the returned string will be truncated to the requested length.
Public methodStatic memberFirst(String, Int32, Char)
Gets the first n characters of the string. The returned string always will be exactly the specified length, and never null. The original string may be null or empty. If the original string is null, empty, or shorter than requested, the returned string will be right-padded with the pad charcter. If the original string is longer than requested, the returned string will be truncated to the requested length.
Top
See Also