Reverse String (original) (raw)
Published on 12 April 2018 (Updated: 16 April 2025)
Welcome to the Reverse String page! Here, you'll find a description of the project as well as a list of sample programs written in various languages.
This article was written by:
- Jeremy Grifski
Description
While Hello World is simple, it often does not show off many interesting features of a language. Fortunately, this repository shares more samples than Hello World. One of these more complex programs is known as Reverse a String.
In this repository, the algorithm must reverse ASCII strings. Do NOTworry about reversing a string in the general case. For instance, if a string contains surrogate pairs, it's okay if the solution corrupts the string during reversal.
Requirements
Despite the explicit name, there are some rules in place for consistency. When writing a Reverse a String program, the following rules should apply:
- The implementation must be executable
- The string to be reversed must come from the command line
- The program must verify the strings existence on the command line
- The user must not import libraries to obfuscate the string manipulation
In other words, the program should get a string from the command line and reverse it using language utilities only. Acceptable language utilities include language features and built-in libraries.
External dependencies are unacceptable. Remember, the goal is to show off language features and utilities.
Testing
Every project in the Sample Programs repo should be tested. In this section, we specify the set of tests specific to Reverse String.
Reverse String Tests
Description | Input | Output |
---|---|---|
No Input | "" | |
Empty Input | "" | "" |
Ascii String | "Hello, World" | "dlroW ,olleH" |
Articles
There are 53 articles:
- Reverse String in Algol68
- Reverse String in Awk
- Reverse String in Bash
- Reverse String in Beef
- Reverse String in Brainfuck
- Reverse String in C
- Reverse String in C#
- Reverse String in C++
- Reverse String in Clojure
- Reverse String in Commodore Basic
- Reverse String in Dart
- Reverse String in Dg
- Reverse String in Elvish
- Reverse String in Erlang
- Reverse String in Euphoria
- Reverse String in Fortran
- Reverse String in Go
- Reverse String in Groovy
- Reverse String in Haskell
- Reverse String in Java
- Reverse String in Javascript
- Reverse String in Julia
- Reverse String in Kotlin
- Reverse String in Lisp
- Reverse String in Lua
- Reverse String in Mathematica
- Reverse String in Moonscript
- Reverse String in Never
- Reverse String in Nim
- Reverse String in Objective C
- Reverse String in Octave
- Reverse String in Odin
- Reverse String in Pascal
- Reverse String in Perl
- Reverse String in Php
- Reverse String in Picolisp
- Reverse String in Powershell
- Reverse String in Python
- Reverse String in R
- Reverse String in Rexx
- Reverse String in Ruby
- Reverse String in Rust
- Reverse String in Scala
- Reverse String in Scheme
- Reverse String in Swift
- Reverse String in Ti Basic
- Reverse String in Typescript
- Reverse String in Unicat
- Reverse String in V
- Reverse String in Vimscript
- Reverse String in Visual Basic
- Reverse String in Wren
- Reverse String in X86 64