C# Program to Reverse a String without using Reverse() Method Last Updated : 16 Nov, 2021 Summarize Comments Improve Suggest changes Share Like Article Like Report C# has a built-in function to reverse a string. First, the string is converted to a character array by using ToCharArray() then by using the Reverse() the character array will be reversed, But in this article, we will understand how to Reverse a String without using Reverse(). Example Input : Geek Output : keeG Input : For Output : roF Method 1: Using a for loop to reverse a string. An empty string is declared and name as ReversedString. The input string will be iterated from right to left and each character is appended to the ReversedString. By the end of the iteration, the ReversedString will have the reversed string stored in it. C# // C# program to reverse a string using a for loop using System; class GFG{ public static string Reverse(string Input) { // Converting string to character array char[] charArray = Input.ToCharArray(); // Declaring an empty string string reversedString = String.Empty; // Iterating the each character from right to left for(int i = charArray.Length - 1; i > -1; i--) { // Append each character to the reversedstring. reversedString += charArray[i]; } // Return the reversed string. return reversedString; } // Driver code static void Main(string[] args) { Console.WriteLine(Reverse("GeeksForGeeks")); } } OutputskeeGroFskeeG Method 2: Using a while loop to reverse a string. In this method, an empty string is declared and name as reversedString now the input string will be iterated from right to left using the while loop, and each character is appended to the reversedString. By the end of the iteration, the reversedString will have the reversed string stored in it. C# // C# program to reverse a string using while loop using System; class GFG{ public static string Reverse(string Input) { // Converting string to character array char[] charArray = Input.ToCharArray(); // Declaring an empty string string reversedString = String.Empty; int length, index; length = charArray.Length - 1; index = length; // Iterating the each character from right to left while (index > -1) { // Appending character to the reversedstring. reversedString = reversedString + charArray[index]; index--; } // Return the reversed string. return reversedString; } // Driver code static void Main(string[] args) { Console.WriteLine(Reverse("GeeksForGeeks")); } } OutputskeeGroFskeeG Comment More infoAdvertise with us Next Article How to Reverse a String in Golang? P pulamolusaimohan Follow Improve Article Tags : C# CSharp LINQ CSharp-programs Similar Reads Program to reverse order of words in a sentence Write a program to reverse the order of words in a given sentence. A word is defined as a sequence of non-space characters. The sentence is a collection of words separated by spaces. Examples: Input: "Hello World"Output: "World Hello" Input: "Programming is fun"Output: "fun is Programming" Approach: 3 min read Program to reverse a sentence Write a program to reverse a sentence. Examples: Input: "Practice with GFG" Output: "GFG htiw ecitcarP" Input: "Programming is fun" Output: "nuf si gnimmargorP" Approach: To solve the problem, follow the below idea: It can be observed that we can reverse a sentence by traversing over the original se 2 min read How to reverse a string in R Reversing a string means changing its order so that the last character becomes the first, the second last character becomes the second, and so on. A while loop is a control flow statement used in R programming to execute a block of code repeatedly as long as a specified condition is true. By using a 4 min read How to Reverse a String in Golang? Given a string and the task is to reverse the string. Here are a few examples. Approach 1: Reverse the string by swapping the letters, like first with last and second with second last and so on. Example: C // Golang program to reverse a string package main // importing fmt import "fmt" // function, 2 min read Reverse the string whenever digit is encountered Given a string s of length N, the task is to traverse the string and reverse the substring from the start to the next encountered digit. After reversing the substring, update the start index to the character immediately following the digit. Example: Input: s = abc123def456ghiOutput: cba123fed456ihg 4 min read Get a Substring in C A substring is a contiguous sequence of characters within a string. In this article, we will learn how to extract a substring using a C program.The simplest method to get a substring from a larger string is by using strncpy() function. Letâs take a look at an example:C++#include <stdio.h> #inc 2 min read Like