Example #1
0
        private object StringIndex(CallSite site, string target, object index)
        {
            if (target != null && index != null && index.GetType() == typeof(int))
            {
                return(StringOps.GetItem(target, (int)index));
            }

            return(((CallSite <Func <CallSite, string, object, object> >)site).Update(site, target, index));
        }
        private object StringIndex(CallSite site, object target, int index)
        {
            if (target is string str)
            {
                return(StringOps.GetItem(str, index));
            }

            return(((CallSite <Func <CallSite, object, int, object> >)site).Update(site, target, index));
        }
Example #3
0
        private object StringIndex(CallSite site, object target, object index)
        {
            string str = target as string;

            if (str != null && index != null && index.GetType() == typeof(int))
            {
                return(StringOps.GetItem(str, (int)index));
            }

            return(((CallSite <Func <CallSite, object, object, object> >)site).Update(site, target, index));
        }