Answers for "how to reverse strings"

28

how to reverse a string in python

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

string = "racecar"
print(string[::-1])
Posted by: Guest on November-26-2020
0

reverse words in a given string

function reverse (word) {
    word = word.split('.').reverse().join('.')
    return word

}
word = 'i.like.this.program.very.much'
word = 'pqr.mno'
console.log(reverse(word))
Posted by: Guest on November-10-2020
0

how to reverse a string in python

user_input = input("Input the sentence you want reversed: ")
print (user_input[::-1])
#This is the easiest way to do it lol
Posted by: Guest on August-06-2021
-1

reverse a string

let t = s.chars().rev().collect::<String>();
Posted by: Guest on February-22-2021

Code answers related to "how to reverse strings"

Code answers related to "Javascript"

Browse Popular Code Answers by Language