Example #1
0
 public static T FirstOrDefault <T>(this ReadOnlyMemory <T> memory)
 => memory.HasContent() ? memory.Span[0] : default;
Example #2
0
 public static T LastOrDefault <T>(this ReadOnlyMemory <T> memory)
 => memory.HasContent() ? memory.Span[memory.Length - 1] : default;
Example #3
0
 public static bool HasNoContent <T>(this ReadOnlyMemory <T> memory)
 => !memory.HasContent();