Exemple #1
0
        public CodeString BetweenOperatos(CodeString Code)
        {
            if (UseMarker)
            {
                var StrLength = Code.Length;
                if (StrLength < 2 || Code[0] != Marker || Code[StrLength - 1] != Marker)
                {
                    return(new CodeString());
                }
            }

            var StartRes = Code.StartsWith(Operators, Skip);
            var EndRes   = Code.EndsWith(Operators, Skip);

            if (StartRes.Index == -1 || EndRes.Index == -1)
            {
                return(new CodeString());
            }
            if (StartRes.Index != EndRes.Index)
            {
                return(new CodeString());
            }

            var Length = StartRes.String.Length;

            if (EndRes.Position < Length)
            {
                return(new CodeString());
            }

            Code = Code.Substring(Length, Code.Length - Length * 2);
            if (Code.Find(Operators, Skip).Index != -1)
            {
                return(new CodeString());
            }
            return(Code);
        }