“Reverse string” Kode Jawaban

cara membalikkan string di python

# in order to make a string reversed in python 
# you have to use the slicing as following

string = "racecar"
print(string[::-1])
Tejas Naik

string terbalik dalam python

'hello world'[::-1]
'dlrow olleh'
Kind Kangaroo

cara membalikkan string di java

public class ReverseString {
    public static void main(String[] args) {
        String s1 = "neelendra";
        for(int i=s1.length()-1;i>=0;i--)
            {
                System.out.print(s1.charAt(i));
            }
    }
}
Annoying Anaconda

Reverse string

// string::rbegin/rend
#include <iostream>
#include <string>

int main ()
{
  std::string str ("now step live...");
  for (std::string::reverse_iterator rit=str.rbegin(); rit!=str.rend(); ++rit)
    std::cout << *rit;
  return 0;
}
JTM

Reverse string

const stringReverse = str => str.split("").reverse().join("");

stringReverse("Welcome to Javascript")
//tpircsavaJ ot emocleW
thefazeelahmed

Reverse string

String name = "gaurav";
    
    String reversedString = new StringBuilder(name).reverse().toString();
    
    System.out.println(reversedString);
rakibul sadik

Jawaban yang mirip dengan “Reverse string”

Jelajahi jawaban kode populer menurut bahasa

Jelajahi bahasa kode lainnya