Пример #1
0
 // Trim the string (remove whitespaces etc, from the beginning and/or end)
 public ktString Trim(ktStripType St)
 {
     return Trim(St, "\n\t ");
 }
Пример #2
0
 public ktString Strip(ktStripType St)
 {
     return Strip(St, new ktString("\n\t "));
 }
Пример #3
0
        // Trim the string (remove whitespaces etc, from the beginning and/or end)
        public ktString Trim(ktStripType St, ktString WS)
        {
            if ((St == ktStripType.both) || (St == ktStripType.leading))
            {
                m_Content = m_Content.TrimStart(WS.GetValue().ToCharArray());
            }
            if ((St == ktStripType.both) || (St == ktStripType.trailing))
            {
                m_Content = m_Content.TrimEnd(WS.GetValue().ToCharArray());
            }

            return this;
        }
Пример #4
0
        public ktString Strip(ktStripType St, ktString Delim)
        {
            string Str = m_Content;

            if ((St == ktStripType.both) || (St == ktStripType.leading))
            {
                Str = Str.TrimStart(Delim.GetValue().ToCharArray());
            }
            if ((St == ktStripType.both) || (St == ktStripType.trailing))
            {
                Str = Str.TrimEnd(Delim.GetValue().ToCharArray());
            }

            return new ktString(Str);
        }