private static readonly Encoding Windows1251Encoding = Encoding.GetEncoding(1251);
static string FromCyrillicStringArray(string[] values)
{
var bytes = new byte[values.Length];
for (var i = 0; i < values.Length; i++)
bytes[i] = Convert.ToByte(values[i]);
return Windows1251Encoding.GetString(bytes);
}
...
var codes = new[] { "207", "192", "207", "192" };
Console.WriteLine(FromCyrillicStringArray(codes) == "ПАПА"); // true
#include <algorithm>
#include <iostream>
#include <string>
int main()
{
std::string strings[] = {"143", "224", "168", "162", "165", "226"};
char line[16] {};
std::transform(std::begin(strings), std::end(strings), std::begin(line),
[](const std::string& s) {
return std::stoi(s); });
std::cout << line;
}
static bool TryGetCharIndices(char element, out int x, out int y)
{
for (var i = 0; i < URusa2.GetLength(0); i++)
{
for (var j = 0; j < URusa2.GetLength(1); j++)
{
if (URusa2[i, j] == element)
{
y = i;
x = j;
return true;
}
}
}
x = -1;
y = -1;
return false;
}