Reverse String in Nim

Published on 22 October 2019 (Updated: 19 March 2023)

Welcome to the Reverse String in Nim page! Here, you'll find the source code for this program as well as a description of how the program works.

Current Solution

# For reversing a string passed in as a parameter
import os
import strutils

var text: string
try:
    text = paramStr(1)
except IndexError:
    quit(0)

var reversed_text: string
for i in countdown(len(text)-1, 0):
  reversed_text = reversed_text & text[i]

echo reversed_text


Reverse String in Nim was written by:

If you see anything you'd like to change or update, please consider contributing.

How to Implement the Solution

No 'How to Implement the Solution' section available. Please consider contributing.

How to Run the Solution

No 'How to Run the Solution' section available. Please consider contributing.