mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-10 02:45:41 +00:00
✨ Add string.IsUpper and string.IsLower
- IsLower: Determines if all alpha characters in this string are considered lowercase. - IsUpper: Determines if all alpha characters in this string are considered uppercase.
This commit is contained in:
parent
72f9474e1c
commit
11ffa43810
@ -4,6 +4,10 @@
|
|||||||
### Added
|
### Added
|
||||||
- Add `string.ChangeEncoding(Encoding, Encoding)`
|
- Add `string.ChangeEncoding(Encoding, Encoding)`
|
||||||
- Converts this string from one encoding to another
|
- Converts this string from one encoding to another
|
||||||
|
- Add `string.IsLower`
|
||||||
|
- Determines if all alpha characters in this string are considered lowercase
|
||||||
|
- Add `string.IsUpper`
|
||||||
|
- Determines if all alpha characters in this string are considered uppercase
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
- n/a
|
- n/a
|
||||||
|
@ -145,6 +145,28 @@
|
|||||||
return encoding.GetBytes(str);
|
return encoding.GetBytes(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if all alpha characters in this string are considered lowercase.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str">The input string.</param>
|
||||||
|
/// <returns>Returns <see langword="true"/> if all alpha characters are lowercase, <see langword="false"/>
|
||||||
|
/// otherwise.</returns>
|
||||||
|
public static bool IsLower(this string str)
|
||||||
|
{
|
||||||
|
return str.Where(char.IsLetter).All(char.IsLower);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Determines if all alpha characters in this string are considered uppercase.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="str">The input string.</param>
|
||||||
|
/// <returns>Returns <see langword="true"/> if all alpha characters are uppercase, <see langword="false"/>
|
||||||
|
/// otherwise.</returns>
|
||||||
|
public static bool IsUpper(this string str)
|
||||||
|
{
|
||||||
|
return str.Where(char.IsLetter).All(char.IsUpper);
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Generates a new random string by filling it with characters found in <see cref="str"/>.
|
/// Generates a new random string by filling it with characters found in <see cref="str"/>.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
Loading…
Reference in New Issue
Block a user