You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
BookingHeChuan/Myshipping.Core/Util/LetterIndexUtil.cs

13 lines
386 B
C#

6 months ago
namespace Myshipping.Core;
public static class LetterIndexUtil
{
/// <summary>
/// 根据当前字母获取它在26个英文字母中的下一个字母
/// </summary>
public static char GetNextLetter(char currentLetter)
{
if (currentLetter == 'z') return 'a';
if (currentLetter == 'Z') return 'A';
return (char)(currentLetter + 1);
}
}