mirror of
https://github.com/toolgood/ToolGood.Words.git
synced 2026-10-17 04:40:38 +08:00
1.8.4版本
This commit is contained in:
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
//可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值,
|
||||
// 方法是按如下所示使用“*”: :
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.8.3.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.3.0")]
|
||||
[assembly: AssemblyVersion("1.8.4.0")]
|
||||
[assembly: AssemblyFileVersion("1.8.4.0")]
|
||||
|
||||
@@ -267,7 +267,6 @@ namespace ToolGood.Words
|
||||
|
||||
/// <summary>
|
||||
/// 中文转数字(支持中文大写)
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="chineseString"></param>
|
||||
/// <returns></returns>
|
||||
@@ -275,8 +274,35 @@ namespace ToolGood.Words
|
||||
{
|
||||
return NumberConventer.ChnToArab(chineseString);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 转成数字
|
||||
/// <summary>
|
||||
/// 【中文】、【符号】,转成【数字】字符串
|
||||
/// </summary>
|
||||
/// <param name="chineseString"></param>
|
||||
/// <returns></returns>
|
||||
public static string TransitionToNumberString(string chineseString)
|
||||
{
|
||||
var str = new StringBuilder();
|
||||
Dictionary<char, char> dictionary = new Dictionary<char, char>();
|
||||
for (int i = 0; i < Dict.nums1.Length; i++) {
|
||||
dictionary[Dict.nums1[i]] = Dict.nums2[i];
|
||||
}
|
||||
|
||||
for (int i = 0; i < chineseString.Length; i++) {
|
||||
var c = chineseString[i];
|
||||
char outc;
|
||||
if (dictionary.TryGetValue(c,out outc)) {
|
||||
str.Append(outc);
|
||||
} else {
|
||||
str.Append(c);
|
||||
}
|
||||
}
|
||||
return str.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user