Answers for "take in a string and reverse it"

2

how to reverse a string

function reverseString(str) {
    return str.split("").reverse().join("");
}
reverseString("hello");
Posted by: Guest on May-13-2020
0

reverse string

 
#include <iostream>
#include <algorithm> 
using namespace std; 
int main() 
{ 
    string str = "Lap trinh khong kho"; 
  
    // Reverse str[beign..end] 
    reverse(str.begin(), str.end()); 
  
    cout << str; 
    return 0; 
}
 
Posted by: Guest on September-08-2021

Code answers related to "take in a string and reverse it"

Code answers related to "Javascript"

Browse Popular Code Answers by Language