예제 #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="range"></param>
        /// <returns></returns>
        public static Range <int> ToRange(this System.Range range)
        {
            var start = range.Start.IsFromEnd ? ~range.Start.Value : range.Start.Value;
            var end   = range.End.IsFromEnd ? ~range.End.Value : range.End.Value;

            return(end < start ? new Range <int>(end, start) : new Range <int>(start, end));
        }
예제 #2
0
        public IResponseOutput TestRang()
        {
            string str = "abcdefghijklmnopq";

            System.Range range = 1..4;

            var s1 = str[range];  //bcd
            var s2 = str[1..^ 1]; //bcdefghijklmnopq
예제 #3
0
        public static T[] GetSubArray <T>(T[] array, System.Range range)
        {
            (int offset, int length) = range.GetOffsetAndLength(array.Length);
            var arr = new T[length];

            for (int i = 0; i < length; i++)
            {
                arr[i] = array[offset + i];
            }
            return(arr);
        }
예제 #4
0
 public static System.Memory <T> AsMemory <T>(this T[] array, System.Range range)
 {
     throw null;
 }
예제 #5
0
 public static System.ReadOnlyMemory <char> AsMemory(this string text, System.Range range)
 {
     throw null;
 }
예제 #6
0
 public static System.Span <T> AsSpan <T>(this T[] array, System.Range range)
 {
     throw null;
 }
예제 #7
0
 public static System.Span <T> AsSpan <T>(this System.ArraySegment <T> segment, System.Range range)
 {
     throw null;
 }
 public bool TryFindLast(System.Utf8String value, System.StringComparison comparisonType, out System.Range range)
 {
     throw null;
 }
 public bool TryFindLast(char value, out System.Range range)
 {
     throw null;
 }
 public bool TryFind(System.Text.Rune value, System.StringComparison comparisonType, out System.Range range)
 {
     throw null;
 }
 public System.Utf8String this[System.Range range] {
     get { throw null; }
 }
 public static System.ReadOnlyMemory <byte> AsMemoryBytes(this System.Utf8String?text, System.Range range)
 {
     throw null;
 }
 public bool TryFindLast(System.Text.Utf8Span value, out System.Range range)
 {
     throw null;
 }
 public System.Text.Utf8Span this[System.Range range] {
     get { throw null; }
 }
예제 #15
0
 public static System.Linq.IQueryable <TSource> Take <TSource>(this System.Linq.IQueryable <TSource> source, System.Range range)
 {
     throw null;
 }
 public static T[] GetSubArray <T>(T[] array, System.Range range)
 {
     throw null;
 }
예제 #17
0
 public static System.ReadOnlyMemory <System.Char8> AsMemory(this System.Utf8String?text, System.Range range)
 {
     throw null;
 }
 public bool TryFindLast(System.Text.Rune value, out System.Range range)
 {
     throw null;
 }
 public bool TryFindLast(System.Utf8String value, out System.Range range)
 {
     throw null;
 }
 public System.ReadOnlySpan <T> AsSpan(System.Range range)
 {
     throw null;
 }