Skip to content
Permalink
Browse files

no need to run a for-loop to change the string's case

  • Loading branch information...
darealshinji committed Jan 22, 2019
1 parent 9fda70d commit 50db38eb26ae02f0a7e39fa66eb6b926ec5d16f6
Showing with 8 additions and 25 deletions.
  1. +8 −25 unit2.pas
@@ -2071,40 +2071,23 @@ procedure TMainForm.btnLoadHashListClick(Sender: TObject);
procedure TMainForm.btnMakeTextLowerClick(Sender: TObject);
var
s : string;
i : integer;
begin
s := memoHashText.Text;
for i := 1 to Length(s) do
begin
if s[i] in ['A'..'Z'] then
begin
s := Lowercase(s);
memoHashText.Text := s;
end;
end;
HashText(memoHashText);
application.ProcessMessages;
s := Lowercase(memoHashText.Text);
memoHashText.Text := s;
HashText(memoHashText);
application.ProcessMessages;
end;

procedure TMainForm.btnMakeTextUpperClick(Sender: TObject);
var
s : string;
i : integer;
begin
s := memoHashText.Text;
for i := 1 to Length(s) do
begin
if s[i] in ['a'..'z'] then
begin
s := Uppercase(s);
memoHashText.Text := s;
end;
end;
HashText(memoHashText);
application.ProcessMessages;
s := Uppercase(memoHashText.Text);
memoHashText.Text := s;
HashText(memoHashText);
application.ProcessMessages;
end;


procedure TMainForm.cbFlipCaseFILEChange(Sender: TObject);
var
i : integer;

0 comments on commit 50db38e

Please sign in to comment.
You can’t perform that action at this time.