挖土

Coding for fun.
posts - 29, comments - 20, trackbacks - 0, articles - 23
  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理

2010年3月31日

 

代码
    public static class StringExtend
    {
        
public static bool IsNullOrEmpty(this string s)
        {
            
return string.IsNullOrEmpty(s);
        }

        
public static bool IsInt(this string s)
        {
            
int i;
            
return int.TryParse(s, out i);
        }

        
public static int ToInt(this string s)
        {
            
return int.Parse(s);
        }
    }

 

 

posted @ 2010-03-31 14:58 挖土. 阅读(124) 评论(3) 编辑