944,205 Members | Top Members by Rank

Ad:
0

function lowcase(s: string): string;

by on Jun 28th, 2009
A simple function that converts alphabetic values into their respective lowercase value.
Pascal and Delphi Code Snippet (Toggle Plain Text)
  1. function lowcase(s: string): string;
  2. var
  3. i: integer;
  4. begin
  5. s := upcase(s);
  6.  
  7. for i := 1 to length(s) do
  8. begin
  9. if s[i] in ['A'..'z'] then // this is to check that s[i] is alphabetic
  10. begin
  11. 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
  12. end;
  13. end;
  14. lowcase := s;
  15. end;
Comments on this Code Snippet
Jul 16th, 2010
0

Re: function lowcase(s: string): string;

Industrious Poster
pyTony is offline Offline
4,210 posts
since Apr 2010
Message:
Previous Thread in Pascal and Delphi Forum Timeline: Using data from .txt file
Next Thread in Pascal and Delphi Forum Timeline: Pascal / Inno Question re: Cardinal





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC