We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,111 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?

function lowcase(s: string): string;

0
By Black Magic on Jun 28th, 2009 6:10 pm

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;
pyTony
pyMod
Moderator
6,307 posts since Apr 2010
Reputation Points: 879
Solved Threads: 986
Skill Endorsements: 26

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.5101 seconds using 2.64MB