Reverse a string in c#

mirajhad

Clever Cottonmouth

Posted on January 16, 2024

Reverse a string in c#
using System;
public class HelloWorld
{
    public static void Main(string[] args)
    {
        string data ="Miraj";
        string di="";
        for(int i= data.Length - 1; i >= 0; i--){
            di+=data[i];
        }
        Console.WriteLine(di);
    }
}
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
mirajhad
Clever Cottonmouth

Posted on January 16, 2024

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related