A Collection of Code Snippets in as Many Programming Languages as Possible
This project is maintained by TheRenegadeCoder
Welcome to the Reverse String in Erlang page! Here, you'll find the source code for this program as well as a description of how the program works.
-module(reverse_string).
-export([start/1]).
-spec start(StringOrAtom :: list() | atom() | integer()) ->
list() | atom() | integer().
%%--------------------------------------------------------------------
%% Reverse a given string, atom, or integer
%%--------------------------------------------------------------------
start(String) when is_list(String) ->
lists:reverse(String);
start(Atom) when is_atom(Atom) ->
list_to_atom(lists:reverse(atom_to_list(Atom)));
start(Number) when is_integer(Number) ->
list_to_integer(lists:reverse(integer_to_list(Number))).
Reverse String in Erlang was written by:
If you see anything you'd like to change or update, please consider contributing.
No 'How to Implement the Solution' section available. Please consider contributing.
No 'How to Run the Solution' section available. Please consider contributing.