Skip to content
This repository has been archived by the owner on Oct 23, 2021. It is now read-only.

sp core library.guid.tryparse

John Nguyen edited this page Apr 22, 2021 · 2 revisions

Home > @microsoft/sp-core-library > Guid > tryParse

Guid.tryParse() method

Attempts to parse the input string to construct a new Guid object. If the string cannot be parsed, then undefined is returned.

Signature:

static tryParse(guid: string | undefined | null): Guid | undefined;

Parameters

Parameter Type Description
guid string | undefined | null The input string.

Returns:

Guid | undefined

The Guid object, or undefined if the string could not be parsed.

Remarks

Example syntaxes accepted by this function:

  • "d5369f3bbd7a412a9c0f7f0650bb5489"

  • "d5369f3b-bd7a-412a-9c0f-7f0650bb5489"

  • "{d5369f3b-bd7a-412a-9c0f-7f0650bb5489}"

  • "/Guid(d5369f3b-bd7a-412a-9c0f-7f0650bb5489)/"

Clone this wiki locally