Try this:
char letter="c";
if (letter == 'z')
nextChar="a";
else if (letter == 'Z')
nextChar="A";
else
nextChar = (char)(((int)letter) + 1);
This way you have no trouble when the char is the last of the alphabet.
More Related Contents:
- How to get the + – / * from char
- Convert char to int in C#
- .NET / C# – Convert char[] to string
- Detecting *all* emojis
- C# How to translate virtual keycode to char?
- Why is there no Char.Empty like String.Empty?
- What is this char? 65279 ”
- What is the correct way to compare char ignoring case?
- Delete last char of string
- How to check if a String contains any letter from a to z? [duplicate]
- Operator ‘==’ cannot be applied to operands of type ‘char’ and ‘string’
- How to get the first five character of a String
- Unable to cast object of type ‘System.Int32’ to type ‘System.String’ error
- Showing Difference between two datetime values in hours
- Data binding dynamic data
- When I post back to my controller all values for my model are null
- C# – code to order by a property using the property name as a string [duplicate]
- How can I write fast colored output to Console?
- Can I specify a generic type in XAML (pre .NET 4 Framework)?
- Generic Type in constructor
- Parse email content from quoted reply
- Changing the cursor in WPF sometimes works, sometimes doesn’t
- Maybe a C# compiler bug in Visual Studio 2015
- How to prevent an exception in a background thread from terminating an application?
- DataTable equivalent in Java [duplicate]
- MSTest cannot find the assembly
- Entity Framework – default values doesn’t set in sql server table
- Pad left or right with string.format (not padleft or padright) with arbitrary string
- How to get enum value by string or int
- Alternatives to Thread.Sleep() for simulating pauses