
- C# Basic Tutorial
- C# - Home
- C# - Overview
- C# - Environment
- C# - Program Structure
- C# - Basic Syntax
- C# - Data Types
- C# - Type Conversion
- C# - Variables
- C# - Constants
- C# - Operators
- C# - Decision Making
- C# - Loops
- C# - Encapsulation
- C# - Methods
- C# - Nullables
- C# - Arrays
- C# - Strings
- C# - Structure
- C# - Enums
- C# - Classes
- C# - Inheritance
- C# - Polymorphism
- C# - Operator Overloading
- C# - Interfaces
- C# - Namespaces
- C# - Preprocessor Directives
- C# - Regular Expressions
- C# - Exception Handling
- C# - File I/O
- C# Advanced Tutorial
- C# - Attributes
- C# - Reflection
- C# - Properties
- C# - Indexers
- C# - Delegates
- C# - Events
- C# - Collections
- C# - Generics
- C# - Anonymous Methods
- C# - Unsafe Codes
- C# - Multithreading
- C# Useful Resources
- C# - Questions and Answers
- C# - Quick Guide
- C# - Useful Resources
- C# - Discussion
C# Program to display a string in reverse alphabetic order
Set a string array and convert it to character array −
string str = "Amit"; char[] arr = str.ToCharArray();
Now, use the Reverse method to display the above string in reverse alphabetic order −
Array.Reverse(arr);
Here is the complete code −
Example
using System; using System.Linq; using System.IO; class Program { static void Main() { string str = "Amit"; char[] arr = str.ToCharArray(); Console.WriteLine("Original String: "+str); // Reverse Array.Reverse(arr); Console.WriteLine("Reversed String: "+new string(arr)); } }
Output
Original String: Amit Reversed String: timA
- Related Articles
- C program to display numbers in reverse order using single linked list
- C# Program to display the last three elements from a list in reverse order
- Swift Program to Print Reverse Pyramid Alphabetic Pattern
- C# program to reverse a string
- Display a TreeSet in reverse order in Java
- C++ program to concatenate strings in reverse order
- C# program to Reverse words in a string
- Print all the palindromic permutations of given string in alphabetic order in C++
- Python program to create a doubly linked list of n nodes and display it in reverse order
- Python program to create a Circular Linked List of n nodes and display it in reverse order
- 8085 program to transfer a block in reverse order
- Sorting string in reverse order in JavaScript
- Python - Display the Contents of a Text File in Reverse Order?
- Java Program to Reverse a String
- Write a program to reverse an array or string in C++

Advertisements