-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathProgram.cs
33 lines (29 loc) · 1.03 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
using System;
namespace ReplaceCharacters
{
class Program
{
static void Main(string[] args)
{
string input = "átençÃo sômóñ";
string newWord = "";
string[] characters = {
"áÁàÀâÂäÄãÃåÅæÆçÇéÉèÈêÊëËíÍìÌîÎïÏñÑóÓòÒôÔöÖõÕøØœŒßúÚùÙûÛüÜ",
"aAaAaAaAaAaAaAcCeEeEeEeEiIiIiIiInNoOoOoOoOoOoOcCBuUuUuUuU"
};
for (int i = 0; i < input.Length; i++)
{
if (characters[0].IndexOf(Convert.ToChar(input.Substring(i, 1))) >= 0)
{
int car = characters[0].IndexOf(Convert.ToChar(input.Substring(i, 1)));
newWord += characters[1].Substring(car, 1);
}
else
{
newWord += input.Substring(i, 1);
}
}
Console.WriteLine(newWord);
}
}
}