Product Information > Version 7.1 Release Information > Upgrading to JADE Release 7.1 > String::asUuid Method (NFS 62803)

String::asUuid Method (NFS 62803)

The String primitive type now provides the asUuid method, which has the following signature.

asUuid(): Binary;

The asUuid method returns a binary by formatting the string as a Universally Unique Identifier (UUID).

If the string is not formatted as a valid UUID representation (that is, as returned by the Binary primitive type uuidAsString method), exception 1407 (Invalid argument passed to method) is raised.

The code fragment in the following example shows the use of the asUuid method.

vars
    str : String;
    bin : Binary;
begin
    str := "4dfc912a-b466-01d0-1027-000085823b00";
    bin := str.asUuid();