开发者

Reverse a Integer Erlang

开发者 https://www.devze.com 2023-01-13 04:04 出处:网络
I am looking f开发者_运维知识库or an easy way to reverse an integer in erlang. Example: 1234 to 4321.You can use some of the built in functions to do this easily.

I am looking f开发者_运维知识库or an easy way to reverse an integer in erlang. Example: 1234 to 4321.


You can use some of the built in functions to do this easily.

1> list_to_integer(lists:reverse(integer_to_list(1234))).
4321
0

精彩评论

暂无评论...
验证码 换一张
取 消