I want to know how can I compare two strings that would tell me if one string is greater that the other one, or not.
I don't want equality/inequality. I want to have the good old alphanumeric ordering.
Example: 'aaaa' ,'aaad', 'aaab' the sorted should be: 'aaaa', 'aaab', 'aaad'
Also, what if I have atoms? How to order atoms? (again a=b or a\=b doesn't do the job, i need order.)
Use the term-ordering predicates @<
and friends.
?- aaaa @< aaab.
true.
?- aaad @>= aaab.
true.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With