StringExtensionsFirst Method |
Name | Description | |
---|---|---|
![]() ![]() | First(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.
|
![]() ![]() | First(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.
|
![]() ![]() | First(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.
|