17 lines
530 B
Plaintext
17 lines
530 B
Plaintext
main =>
|
|
println(member=findall(C,(member(C,S1), C @< 'l') )),
|
|
|
|
% find substrings using append/3
|
|
S = "string",
|
|
println(append=findall([A,B],append(A,B,S))),
|
|
% split around "r"
|
|
println(append=findall([A,B],append(A,"r",B,S))),
|
|
|
|
% select a character and returns the list without that character
|
|
println(select=findall([C,NewS],select(C,S,NewS))),
|
|
|
|
% list comprehension
|
|
println(list_comprehension=[ C : C in S5, membchk(C,"aeiou")]),
|
|
% sort and remove duplicates
|
|
println(sort_remove_dups=sort_remove_dups(S5)).
|