Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello!

I wanna do a translater on thats using an array with index a string. Like this:

C#
string[] Words = new string[10];
//How can I do this:
Words["Hello"] = "Zdrasti";//Zdrasti a Bulgrian word


But I do not know how!(If it is possible). I looked the articles - There was nothing like this!

Pls if it is help me.
Posted

Hey Radoslav,
The solution you expecting itself a big task. .NET doesn't know Bulgrian first of all. So the combination logic or what so ever is not possible by just using string concatenation.

You can build your own dictionary for Bulgrian or use third party tools (Try Google Language tools) which does that.
 
Share this answer
 
Comments
Radoslav Dimitrov 9-May-13 8:20am    
Yea thats working too, but I like the dictionary more :)
You can't do it using an array, because a vanilla array has only numeric indexes.

But you can do it with a Dictionary:
C#
Dictionary<string, string> Words = new Dictionary<string, string>();
Words["hello"] = "Zdrasti";
 
Share this answer
 
Comments
Radoslav Dimitrov 9-May-13 8:16am    
Tnx it is working.
OriginalGriff 9-May-13 8:19am    
You're welcome!
JayantaChatterjee 9-May-13 9:15am    
My Vote of 5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900