Search Results for

    Show / Hide Table of Contents

    Struct SpanChar

    Provides a type- and memory-safe representation of a contiguous region of arbitrary char 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 SpanChar

    Constructors

    | Improve this Doc View Source

    SpanChar(Char[])

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

    Declaration
    public SpanChar(char[] array)
    Parameters
    Type Name Description
    Char[] array

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

    | Improve this Doc View Source

    SpanChar(Char[], Int32, Int32)

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

    Declaration
    public SpanChar(char[] array, int start, int length)
    Parameters
    Type Name Description
    Char[] 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 SpanChar Empty { get; }
    Property Value
    Type Description
    SpanChar
    | 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 char this[int index] { get; set; }
    Parameters
    Type Name Description
    Int32 index

    The zero-based index of the element.

    Property Value
    Type Description
    Char

    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(SpanChar)

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

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

    The destination System.Span object.

    Exceptions
    Type Condition
    ArgumentException

    destination is shorter than the source SpanChar.

    | Improve this Doc View Source

    Slice(Int32)

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

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

    The index at which to begin the slice.

    Returns
    Type Description
    SpanChar

    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 SpanChar starting at a specified index for a specified length.

    Declaration
    public readonly SpanChar 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
    SpanChar

    A SpanChar that consists of length number of elements from the current SpanChar 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 SpanChar into a new array.

    Declaration
    public readonly char[] ToArray()
    Returns
    Type Description
    Char[]

    An array containing the data in the current span.

    Operators

    | Improve this Doc View Source

    Implicit(Char[] to SpanChar)

    Implicit conversion of an array to a SpanChar.

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