public ReadOnlySpan<T> GetValueOrDefault(
ReadOnlySpan<T> defaultValue = default
)
Public Function GetValueOrDefault (
Optional defaultValue As ReadOnlySpan(Of T) = Nothing
) As ReadOnlySpan(Of T)
Dim instance As NullableReadOnlySpan
Dim defaultValue As ReadOnlySpan(Of T)
Dim returnValue As ReadOnlySpan(Of T)
returnValue = instance.GetValueOrDefault(defaultValue)
public:
ReadOnlySpan<T> GetValueOrDefault(
ReadOnlySpan<T> defaultValue = ReadOnlySpan<T>()
)
This method provides an alternative to using the ?? operator, which does not work with the NullableReadOnlySpanT structure.
If the value used for defaultValue is expensive to construct, consider using the GetValueOrElse(ReadOnlySpanFuncT) method instead.