SVN r1205
SVN-Revision: r1205
This commit is contained in:
@@ -91,30 +91,15 @@ namespace Lskj.Util
|
||||
/// <returns>System.String.</returns>
|
||||
public static string Replace(this string str, string key, string value, bool ignoreCase)
|
||||
{
|
||||
if (string.IsNullOrEmpty(str)) return str;
|
||||
//if (string.IsNullOrEmpty(str)) return str;
|
||||
|
||||
return Regex.IsMatch(str, key, RegexOptions.IgnoreCase) ?
|
||||
System.Text.RegularExpressions.Regex.Replace(str, key, value, ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None)
|
||||
: str;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期: </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="text">The text.</param>
|
||||
public static bool IsChinese(this string text)
|
||||
{
|
||||
for (int i = 0; i < text.Length; i++)
|
||||
//return Regex.IsMatch(str, key, RegexOptions.IgnoreCase) ?
|
||||
// System.Text.RegularExpressions.Regex.Replace(str, key, value, ignoreCase ? RegexOptions.IgnoreCase : RegexOptions.None)
|
||||
// : str;
|
||||
if (string.IsNullOrEmpty(str) || string.IsNullOrEmpty(key))
|
||||
{
|
||||
if ((int)text[i] > 127)
|
||||
return true;
|
||||
return str;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var comparison = ignoreCase
|
||||
? StringComparison.Ordinal
|
||||
Reference in New Issue
Block a user