uppercase - Convert string to Upper and Lower case Turbo Prolog -
how convert string upper , lower case in turbo prolog.
string_upper
, string_lower
function swi prolog,
i found like,
tolower([], []). tolower([upper|uppertail], [lower|lowertail]) :- char_type(lower, to_lower(upper)), tolower(uppertail, lowertail).
but didn't is. can me solve this.
i did using upper_lower(),
write("enter string convert\n"), readln(str1), upper_lower(str1,low), write("in lower case "), write(low),nl, write("in upper case "), upper_lower(upp,str1), write(upp).
the upper_lower predicate: upper_lower predicate can used convert uppercase characters lowercase, or lowercase letters uppercase. general form of predicate upper_lower(uppercasestring, lowercaseuppercasestring)
Comments
Post a Comment