function lowcase(s: string): string;
var
  i: integer;
begin
  s := upcase(s);

  for i := 1 to length(s) do
  begin
    if s[i] in ['A'..'z'] then // this is to check that s[i] is alphabetic
    begin
      s[i] := chr(ord(s[i]) + 32); // convert s[i] to a numeric value, then + 32 to it, and convert the final numeric value into a char
    end;
  end;
  lowcase := s;
end;
2
Contributors
1
Reply
5
Views
7 Years
Discussion Span
Last Post by pyTony
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.