Search Results for

    Show / Hide Table of Contents

    Struct SpanInt

    Provides a type- and memory-safe representation of a contiguous region of arbitrary int array

    Inherited Members
    ValueType.Equals(Object)
    Object.ToString()
    Object.Equals(Object, Object)
    Object.ReferenceEquals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Namespace: System
    Assembly: Iot.Device.CharacterLcd.dll
    Syntax
    public ref readonly struct SpanInt

    Constructors

    | Improve this Doc View Source

    SpanInt(Int32[])

    Creates a new System.SpanInt object over the entirety of a specified array.

    Declaration
    public SpanInt(int[] array)
    Parameters
    Type Name Description
    Int32[] array

    The array from which to create the System.Span object.

    | Improve this Doc View Source

    SpanInt(Int32[], Int32, Int32)

    Creates a new System.SpanInt object that includes a specified number of elements of an array starting at a specified index.

    Declaration
    public SpanInt(int[] array, int start, int length)
    Parameters
    Type Name Description
    Int32[] array

    The source array.

    Int32 start

    The index of the first element to include in the new System.Span

    Int32 length

    The number of elements to include in the new System.Span

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    array is null, but start or length is non-zero

    -or-

    start is outside the bounds of the array.

    -or-

    start + length exceed the number of elements in the array.

    Properties

    | Improve this Doc View Source

    Empty

    Returns an empty System.Span object.

    Declaration
    public static readonly SpanInt Empty { get; }
    Property Value
    Type Description
    SpanInt
    | Improve this Doc View Source

    IsEmpty

    Returns a value that indicates whether the current System.Span is empty. true if the current span is empty; otherwise, false.

    Declaration
    public readonly bool IsEmpty { get; }
    Property Value
    Type Description
    Boolean
    | Improve this Doc View Source

    Item[Int32]

    Gets the element at the specified zero-based index.

    Declaration
    public readonly int this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    The zero-based index of the element.

    Property Value
    Type Description
    Int32

    The element at the specified index.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    index is out of range.

    | Improve this Doc View Source

    Length

    Returns the length of the current span.

    Declaration
    public readonly int Length { get; }
    Property Value
    Type Description
    Int32

    Methods

    | Improve this Doc View Source

    CopyTo(SpanInt)

    Copies the contents of this System.Span into a destination System.Span.

    Declaration
    public readonly void CopyTo(SpanInt destination)
    Parameters
    Type Name Description
    SpanInt destination

    The destination System.Span object.

    Exceptions
    Type Condition
    ArgumentException

    destination is shorter than the source SpanInt.

    | Improve this Doc View Source

    Slice(Int32)

    Forms a slice out of the current SpanInt that begins at a specified index.

    Declaration
    public readonly SpanInt Slice(int start)
    Parameters
    Type Name Description
    Int32 start

    The index at which to begin the slice.

    Returns
    Type Description
    SpanInt

    A span that consists of all elements of the current span from start to the end of the span.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    start is < zero or > Length.

    | Improve this Doc View Source

    Slice(Int32, Int32)

    Forms a slice out of the current SpanInt starting at a specified index for a specified length.

    Declaration
    public readonly SpanInt Slice(int start, int length)
    Parameters
    Type Name Description
    Int32 start

    The index at which to begin this slice.

    Int32 length

    The desired length for the slice.

    Returns
    Type Description
    SpanInt

    A SpanInt that consists of length number of elements from the current SpanInt starting at start.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    start or start + length is < zero or > Length.

    | Improve this Doc View Source

    ToArray()

    Copies the contents of this SpanInt into a new array.

    Declaration
    public readonly int[] ToArray()
    Returns
    Type Description
    Int32[]

    An array containing the data in the current span.

    Operators

    | Improve this Doc View Source

    Implicit(Int32[] to SpanInt)

    Implicit conversion of an array to a SpanInt.

    Declaration
    public static implicit operator SpanInt(int[] array)
    Parameters
    Type Name Description
    Int32[] array
    Returns
    Type Description
    SpanInt
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2018 nanoFramework Contributors
    Generated by DocFX