奥杰cms源码 - ContentEdit(十一)
本文来源:网站建设-网站制作|网络营销专家慧云科技-抢滩登陆2009-7-16 15:41:15
/// <summary>
/// (辅助函数) 判断字符串是否为 字符串 形式
/// </summary>
private static string IsString( string v )
{
string r = "";
if( (v.StartsWith( "\"" ) && v.EndsWith( "\"" )) || (v.StartsWith( "\‘" ) && v.EndsWith( "\‘" )) ) {
int lenth = v.Length;
r = v.Substring( 1, lenth - 2 );
r = r.Trim();
return r;
} else
return r;
}
/// <summary>
/// (辅助函数) 判断字符串是否为 Top10 形式
/// </summary>
private static bool IsTopValue( string str )
{
return Regex.IsMatch( str, @"^top\s+\d+$", RegexOptions.IgnoreCase );
}
/// <summary>
/// (辅助函数) 判断字符串是否为 数字 形式
/// </summary>
public static bool IsNumber( string str )
{
return Regex.IsMatch( str, @"^\+?[1-9][0-9]*$" );
}
}