Cute_demon_attacks/meng_yao/Assets/communal/tool/ArabicToChineseNumberConverter.cs
舒荣森 fe109c7b14 add
2024-11-01 02:27:50 +08:00

35 lines
800 B
C#

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', "¶þ" },
{ '3', "Èý" },
{ '4', "ËÄ" },
{ '5', "Îå" },
{ '6', "Áù" },
{ '7', "Æß" },
{ '8', "°Ë" },
{ '9', "¾Å" },
{ '0', "Áã" }
};
string result = "";
foreach (char c in input)
{
if (numberMap.ContainsKey(c))
{
result += numberMap[c];
}
}
return result;
}
}