예제 #1
0
 /// <summary>Checks if the sequences of characters <c>what</c> is equal to
 /// <c>sb.Substring(start, what.Length)</c>, without actually creating a
 /// substring object.</summary>
 public static bool SubstringEquals(StringBuilder sb, int start, UString what, bool ignoreCase = false)
 {
     CheckParam.IsNotNegative("start", start);
     if (start > sb.Length - what.Length)
     {
         return(false);
     }
     return(SubstringEqualHelper(sb, start, what, ignoreCase));
 }
예제 #2
0
 /// <summary>Returns the rightmost <c>length</c> code units of the string,
 /// or fewer if the string length is less than <c>length</c>.</summary>
 public UString Right(int length)
 {
     CheckParam.IsNotNegative("length", length);
     length = System.Math.Min(_count, length);
     return(new UString(_start + _count - length, length, _str));
 }