Reputation: 61
I want to convert a string list to number list. It is implemented in Prolog.
For example:
L = ['21', '45', '06']
should become
X = [21, 45, 6]
How to code this in Prolog?
Upvotes: 1
Views: 98
Reputation: 2662
In one line: maplist(atom_number,L,LO)
using maplist/3
and atom_number/2
.
Upvotes: 2