An example lifted from one of my programs, but note that you have to set your strings inside a
TStringList (or any other TStrings descendant; in my case it's used with a ListBox items):
{Randomly shuffle the items in List}
procedure Shuffle(const List: TStrings);
var
Strings: array of String;
i, Max, Take: Integer;
begin
if Assigned(List) and (List.Count > 1) then begin
SetLength(Strings, List.Count);
Max := List.Count-1 ;
for i := 0 to Max do begin
Take := Random(List.Count);
Strings[i] := List[Take];
List.Delete(Take);
end;
Assert(List.Count = 0, 'Shuffle: List should now be empty but isn''t');
List.AddStrings(Strings);
end;
end;