Scriban.Runtime.ScriptBinaryExpression.RangeExclude C# (CSharp) Method

RangeExclude() private static method

private static RangeExclude ( int left, int right ) : IEnumerable
left int
right int
return IEnumerable
        private static IEnumerable<int> RangeExclude(int left, int right)
        {
            // unit test: 150-range-expression.txt
            if (left < right)
            {
                for (int i = left; i < right; i++)
                {
                    yield return i;
                }
            }
            else
            {
                for (int i = left; i > right; i--)
                {
                    yield return i;
                }
            }
        }