/// 看字符串的长度是不是在限定数之间 一个中文为两个字符 |
/// |
/// 字符串 |
/// 大于等于 |
/// 小于等于 |
/// |
public static bool IsLengthStr ( string source, int begin, int end ) |
{ |
int length = Regex.Replace ( source, @"[^\x00-\xff]" , "OK" ).Length; |
if ( ( length <= begin ) && ( length >= end ) ) |
{ |
return false ; |
} |
return true ; |
} |
by: 发表于:2018-01-31 15:11:36 顶(0) | 踩(0) 回复
??
回复评论