-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
completedIssue completed and committed to develop. To be closed on next releaseIssue completed and committed to develop. To be closed on next releaseenhancementNew feature or requestNew feature or request
Milestone
Description
Suggest new routine, with following attributes:
Decription
Returns a random string from the given string list, which must not be empty.
An ERangeError
exception is raised if the string list is empty.
Source code
function RandomString(const SL: TStrings): string;
begin
if SL.Count = 0 then
raise ERangeError.Create('RandomString called with empty string list');
Result := SL[Random(SL.Count)];
end;
Snippet type
Routine.
Category
String Management
Required units
SysUtils, Classes.
Required snippets
None.
XRefs
None.
Extra
None.
Metadata
Metadata
Assignees
Labels
completedIssue completed and committed to develop. To be closed on next releaseIssue completed and committed to develop. To be closed on next releaseenhancementNew feature or requestNew feature or request
Projects
Status
Completed