1,105,399 Community Members

function lowcase(s: string): string;

Member Avatar
Reputation Points: 15 [?]
Q&As Helped to Solve: 4 [?]
Skill Endorsements: 0 [?]
 
0
 

A simple function that converts alphabetic values into their respective lowercase value.

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;
Member Avatar
pyTony
pyMod
6,103 posts since Apr 2010
Reputation Points: 818 [?]
Q&As Helped to Solve: 1,056 [?]
Skill Endorsements: 42 [?]
Moderator
Featured
 
0
 
You
Post:
Start New Discussion
Tags Related to this Article