PDA

View Full Version : Word "Capitalizer"



sm321
05-22-2012, 09:16 AM
Hello :) I am looking for another script, but this one is a bit more complicated. I am looking for something that does this:

Has an input function
Takes the given words and randomizes the case of the letter
E.g. If the input was


Hello
Villavu

The output would be


hEllO
vILLavU

Thankyou.

Dgby714
05-22-2012, 09:36 AM
function randomCase(const s: string): string;
var
L, I: LongInt;
begin
Result := '';

L := Length(s);
for I := 1 to L do
case Random(2) of
0: Result := Result + Uppercase(s[i]);
1: Result := Result + Lowercase(s[i]);
end;
end;

sm321
05-22-2012, 09:56 AM
function randomCase(const s: string): string;
var
L, I: LongInt;
begin
Result := '';

L := Length(s);
for I := 1 to L do
case Random(2) of
0: Result := Result + Uppercase(s[i]);
1: Result := Result + Lowercase(s[i]);
end;
end;

Thankyou :)