Ejemplo n.º 1
0
        public ktString[] SplitAsArr(ktString Input, int Count)
        {
            // If we have a pattern?!
            if ((m_Pattern.IsEmpty()) || (m_P == null))
            {
                // Set error (throw exeption??) and return false
                throw new ktError("ktRegExp::Split(): The pattern is not set!", ktERR.NOTSET);
            }

            string[] OrgParts = m_P.Split(Input, Count);
            ktString[] Parts = new ktString[OrgParts.Length];
            int Pos = 0;

            foreach (string Part in OrgParts)
            {
                Parts.SetValue(new ktString(Part), Pos);
                Pos++;
            }

            return Parts;
        }