Exemple #1
0
        public static ICharSequence Trim(this ICharSequence formattedText)
        {
            System.String text = formattedText.ToString();

            Int32 start;

            for (start = 0; start < text.Length; start++)
            {
                if (!Char.IsWhiteSpace(text[start]))
                {
                    break;
                }
            }

            Int32 end;

            for (end = text.Length - 1; end >= 0; end--)
            {
                if (!Char.IsWhiteSpace(text[end]))
                {
                    break;
                }
            }

            return(formattedText.SubSequenceFormatted(start, end + 1));
        }
        public static ICharSequence Trim(this ICharSequence sequence)
        {
            System.String charSequence = sequence.ToString();

            Int32 start;

            for (start = 0; start < charSequence.Length; start++)
            {
                if (!Char.IsWhiteSpace(charSequence[start]))
                {
                    break;
                }
            }

            Int32 end;

            for (end = charSequence.Length - 1; end >= 0; end--)
            {
                if (!Char.IsWhiteSpace(charSequence[end]))
                {
                    break;
                }
            }

            return(sequence.SubSequenceFormatted(start, end + 1));
        }
 private static ICharSequence limitCharSequenceLength(ICharSequence cs)
 {
     if (cs == null)
     {
         return(cs);
     }
     if (cs.Length() > MaxCharSequenceLength)
     {
         cs = cs.SubSequenceFormatted(0, MaxCharSequenceLength);
     }
     return(cs);
 }
 public void PutText(SpannableString originalText)
 {
     _originalText = originalText;
     if (_originalText.Length() > TRIM_LENGTH)
     {
         _trimmedText = TextUtils.ConcatFormatted(_originalText.SubSequenceFormatted(0, TRIM_LENGTH),
                                                  new SpannableString("..."));
     }
     else
     {
         _trimmedText = _originalText;
     }
     this.TextFormatted = _trimmedText;
 }
 private static ICharSequence limitCharSequenceLength(ICharSequence cs) {
   if (cs == null) {
     return cs;
   }
   if (cs.Length() > MaxCharSequenceLength) {
     cs = cs.SubSequenceFormatted(0, MaxCharSequenceLength);
   }
   return cs;
 }
Exemple #6
0
 public ICharSequence SubSequenceFormatted(int start, int end)
 {
     return(_sequence.SubSequenceFormatted(start, end));
 }