Cute_demon_attacks/meng_yao/Assets/communal/tool/ArabicToChineseNumberConverter.cs

35 lines
800 B
C#
Raw Normal View History

2024-11-01 02:27:50 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class ArabicToChineseNumberConverter : MonoBehaviour
{
public static string ConvertToChineseNumbers(string input)
{
Dictionary<char, string> numberMap = new Dictionary<char, string>
{
{ '1', "һ" },
{ '2', "<22><>" },
{ '3', "<22><>" },
{ '4', "<22><>" },
{ '5', "<22><>" },
{ '6', "<22><>" },
{ '7', "<22><>" },
{ '8', "<22><>" },
{ '9', "<22><>" },
{ '0', "<22><>" }
};
string result = "";
foreach (char c in input)
{
if (numberMap.ContainsKey(c))
{
result += numberMap[c];
}
}
return result;
}
}