Sign in Join
FPDoc Onlineexperiment

RandomFrom function

In unit StrUtils

Choose a random string from an array of strings.

Declaration

pascal
function RandomFrom(const AValues: Array of string = string): string
 ; overload

Arguments

AValues

Strings to choose from.

Function result

Random string picked from the array.

Description

RandomFrom picks at random a valid index in the array AValues and returns the string at that position in the array.

Errors

None.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.