Cogito.Reflection.PortableExecutable/Extensions/ReadOnlySpanExtensions.cs
/// <summary>
/// Gets the length of a C-style string. If no NULL is found, returns the total length of the span.
/// </summary>
/// <param name="self"></param>
/// <returns></returns>
Gets the length of a C-style string. If no NULL is found, returns the total length of the span.
Gets the length of a C - style string . If no NULL is found returns the total length of the span .
static int LengthOfCString(ReadOnlySpan<byte> self)
        {
            for (int i = 0; i < self.Length; i++)
                if (self[i] == 0x00)
                    return i;
            return self.Length;
        }
static int LengthOfCString ( ReadOnlySpan < byte > self ) { for ( int i = 0 ; i < self . Length ; i ++ ) if ( self [ i ] == 0x00 ) return i ; return self . Length ; }
Gets the length of a C-style string.
Gets the length of a C - style string .
None
self
ReadOnlySpan<byte>
None