當前位置: 首頁>>代碼示例>>C#>>正文


C# StringComparison.ToString方法代碼示例

本文整理匯總了C#中System.StringComparison.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# StringComparison.ToString方法的具體用法?C# StringComparison.ToString怎麽用?C# StringComparison.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.StringComparison的用法示例。


在下文中一共展示了StringComparison.ToString方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: EqualsTest

 void EqualsTest(StringComparison compare, int count)
 {
     Console.WriteLine("\r\na.Equals(b, StringComparison.{0}):",compare.ToString());
     Stopwatch watch = new Stopwatch();
     watch.Start();
     for (int i = 0; i < count; i++)
     {
         bool re = a.Equals(b, compare);
     }
     watch.Stop();
     double time = watch.Elapsed.TotalSeconds;
     Console.Write(time);
 }
開發者ID:henrydem,項目名稱:yongfa365doc,代碼行數:13,代碼來源:StringCompare.cs

示例2: Test6

 public virtual object Test6(object x, StringComparison sc) {
     return "C# Test6" + x.ToString() + sc.ToString();
 }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:3,代碼來源:InheritTest.cs

示例3: Test5

 public virtual object Test5(StringComparison sc) {
     return "C# Test5" + sc.ToString();
 }
開發者ID:jxnmaomao,項目名稱:ironruby,代碼行數:3,代碼來源:InheritTest.cs

示例4: CreateStringEqualsExpression

        protected CodeExpression CreateStringEqualsExpression(StringComparison stringComparison, CodeExpression left, CodeExpression right)
        {
            if (left == null) throw new ArgumentNullException("left");
            if (right == null) throw new ArgumentNullException("right");

            return new CodeMethodInvokeExpression(new CodeTypeReferenceExpression(typeof(string)), "Equals", left, right,
                new CodeFieldReferenceExpression(new CodeTypeReferenceExpression(typeof(StringComparison)), stringComparison.ToString()));
        }
開發者ID:modulexcite,項目名稱:CodeFluent-Entities,代碼行數:8,代碼來源:AspNetIdentityCodeUnitProducer.cs

示例5: ShouldStartWith

 public static void ShouldStartWith(this string str, string expected, StringComparison stringComparison = StringComparison.CurrentCultureIgnoreCase, string message = "")
 {
     Assert.IsTrue(str.StartsWith(expected, stringComparison),
        String.Format("The following do not match start of string using string comparison '{0}':\n {1} [Actual]\b {1} [Expected]", stringComparison.ToString(), str, expected));
 }
開發者ID:AndyCC,項目名稱:Jumbleblocks-website,代碼行數:5,代碼來源:TestHelpers.String.cs

示例6: ShouldEqual

 public static void ShouldEqual(this string str, string expected, StringComparison stringComparison, string message = "")
 {
     if(!String.Equals(str, expected, stringComparison))
         Assert.Fail("The following do not match using string comparison '{0}':\n {1} [Actual]\b {1} [Expected]", stringComparison.ToString(), str, expected);
 }
開發者ID:AndyCC,項目名稱:Jumbleblocks-website,代碼行數:5,代碼來源:TestHelpers.String.cs

示例7: Str

 public static void Str(this ExtensionMethodInvokerTest self, StringComparison cmp)
 {
     self.Text.Append(cmp.ToString());
 }
開發者ID:ChillyFlashER,項目名稱:Nine.Imaging,代碼行數:4,代碼來源:ExtensionMethodInvokerTest.cs


注:本文中的System.StringComparison.ToString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。