Skip to content

GenerateId

String GenerateId(String prefix)

System · system operation · implicitly imported

Generates a new unique id with the given prefix.

The generated id has the form <prefix>.<UUID>.

Parameters

  • String prefix — The prefix of the id, e.g. the id of the containing package.

Returns

String — The generated id.

Errors

A runtime type error if prefix is not a String.

Examples

String id = GenerateId("MyPackage");

See Also