/// <summary> /// Gets the SystemStringId for a particular system string. /// </summary> /// <param name="utf8String">The system string to get the enum id for.</param> /// <param name="systemStringId">The id of the system string if found.</param> /// <returns>The SystemStringId for a particular system string.</returns> public static bool TryGetSystemStringId(ReadOnlySpan <byte> utf8String, out int systemStringId) { int?id = SystemStrings.GetSystemStringId(utf8String); if (!id.HasValue) { systemStringId = default; return(false); } systemStringId = id.Value; return(true); }
/// <summary> /// Gets the SystemStringId for a particular system string. /// </summary> /// <param name="utf8Span">The system string to get the enum id for.</param> /// <param name="systemStringId">The id of the system string if found.</param> /// <returns>The SystemStringId for a particular system string.</returns> public static bool TryGetSystemStringId(Utf8Span utf8Span, out int systemStringId) { int?id = SystemStrings.GetSystemStringId(utf8Span); if (!id.HasValue) { systemStringId = default; return(false); } systemStringId = id.Value; return(true); }