javascript reverse a string
function reverseString(s){
return s.split("").reverse().join("");
}
reverseString("Hello");//"olleH"
javascript reverse a string
function reverseString(s){
return s.split("").reverse().join("");
}
reverseString("Hello");//"olleH"
c# reverse string
public static string ReverseString(string s)
{
char[] arr = s.ToCharArray();
Array.Reverse(arr);
return new string(arr);
}
c# reverse a string
public static void Main(string[] args)
{
string s = "aeiouXYZ";
Console.Write(Reverse(s) );
}
public static string Reverse(string s)
{
var result = new string(s.ToCharArray().Reverse().ToArray() );
return result;
}
------------------------------------------------------Option 2
foreach (int v in values.Select(x => x).Reverse())
{
Console.Write(v + " ");
}
reverse string c#
string str = "Hello World!"; // the string which you want to reverse
string reverse = "";
int length = str.Length - 1;
while(length >= 0)
{
reverse += str[length];
length--;
}
Console.WriteLine(reverse); // output: "!dlroW olleH"
c# reverse array
using System;
namespace Demo {
class MyArray {
static void Main(string[] args) {
int[] list = { 29, 15, 30, 98};
int[] temp = list;
Console.Write("Original Array: ");
foreach (int i in list) {
Console.Write(i + " ");
}
Console.WriteLine();
// reverse the array
Array.Reverse(temp);
Console.Write("Reversed Array: ");
foreach (int i in temp) {
Console.Write(i + " ");
}
Console.ReadKey();
}
}
}
c# string reverse
static class StringExtensions
{
public static string Reverse(this string metin)
{
return new string(metin.ToCharArray().Reverse().ToArray());
}
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us