Answer the question
In order to leave comments, you need to log in
How to display text in a column in TelegramBot?
Example:
Tried by analogy with the console application, but this result does not work.
The code:
WebClient webc = new WebClient();
string strhtml = webc.DownloadString("https://www.cbr-xml-daily.ru/daily_utf8.xml");
string str = $"{"Валюта",-25}{"Номинал",-10}{"Курс",-7}";
Regex regex = new Regex(@"<CharCode>EUR</CharCode><Nominal>(.*?)</Nominal><Name>Евро</Name><Value>(.*?)</Value>");
Match match = regex.Match(strhtml);
str += $"\n{"Евро",-25}{match.Groups[1],-10}{match.Groups[2],-7}";
regex = new Regex(@"<CharCode>USD</CharCode><Nominal>(.*?)</Nominal><Name>Доллар США</Name><Value>(.*?)</Value>");
match = regex.Match(strhtml);
str += $"\n{"Доллар США",-25}{match.Groups[1],-10}{match.Groups[2],-7}";
Console.WriteLine(str);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question