Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
Way to increment a character in C#
Firstly, set a character−
char ch = 'K';
Now simply increment it like this −
ch++;
If you will print the character now, it would be the next character as shown in the following example −
Example
using System;
using System.Collections.Generic;
class Demo {
static void Main() {
char ch = 'K';
Console.WriteLine("Initial character:"+ch);
// increment character
ch++;
Console.WriteLine("New character:"+ch);
}
}
Output
Initial character:K New character:L
Advertisements
