35 lines
800 B
C#
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', "<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;
|
|||
|
}
|
|||
|
}
|