Ejemplo n.º 1
0
 public void EndWithTest(StringComparison type)
 {
     if (type == StringComparison.Ordinal)
     {
         Assert.AreEqual(s1.EndsWith(new MutableString("aba"), StringComparison.Ordinal), false);
         Assert.AreEqual(s1.EndsWith(new MutableString("AbA"), StringComparison.Ordinal), true);
     }
     else if (type == StringComparison.OrdinalIgnoreCase)
     {
         Assert.AreEqual(s1.EndsWith(new MutableString("aba"), StringComparison.OrdinalIgnoreCase), true);
         Assert.AreEqual(s1.EndsWith(new MutableString("AbA"), StringComparison.OrdinalIgnoreCase), true);
     }
 }
Ejemplo n.º 2
0
        public static bool EndsWith(RubyScope/*!*/ scope, MutableString/*!*/ self,
            [DefaultProtocol, Optional]MutableString subString) {

            // TODO: Deal with encodings

            if (subString == null || self.Length < subString.Length) {
                return false;
            }
            return self.EndsWith(subString.ConvertToString());
        }