[C#] C#将一个类的不同部分分布在不同的文件中的方法 →→→→→进入此内容的聊天室

来自 , 2019-12-09, 写在 C#, 查看 152 次.
URL http://www.code666.cn/view/a9883e7b
  1.  
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5.  
  6. namespace PartialClassesExample
  7. {
  8.     // 使用 partial 关键字可以在其他 .cs 文件中定义
  9.     // 此类的附加方法、字段和属性。
  10.     // 此文件包含 CharValues 定义的私有方法。
  11.     partial class CharValues
  12.     {
  13.         private static bool IsAlphabetic(char ch)
  14.         {
  15.             if (ch >= 'a' && ch <= 'z')
  16.                 return true;
  17.             if (ch >= 'A' && ch <= 'Z')
  18.                 return true;
  19.             return false;
  20.         }
  21.  
  22.         private static bool IsNumeric(char ch)
  23.         {
  24.             if (ch >= '0' && ch <= '9')
  25.                 return true;
  26.             return false;
  27.         }
  28.     }
  29. }
  30.  
  31.  
  32.  
  33. //csharp/4920

回复 "C#将一个类的不同部分分布在不同的文件中的方法"

这儿你可以回复上面这条便签

captcha