long? catCode = null; // Если строка val не пустая, if (!(String.IsNullOrWhiteSpace(val))) { // распознаем в первых цифрах до пробела целое 64-битное число. // Если его там нет, записываем в catCode NULL. // Если его удалось распознать, записываем его в catCode. if (!(Int64.TryParse(val.Split(" ")[0], out long cc))) { catCode = null; } else { catCode = cc; } }
Как переписать этот код чуть понятнее?
⏩Как вариант, можно написать что-то в духе:
public static string LeftDigits(this string str) { if (str == null) return null; if (!str.contains(" ") return null; string left = str.Split(" ")[0]; if (! left.All(Char.IsDigit){ return null; } return left; }
long? catCode = null; // Если строка val не пустая, if (!(String.IsNullOrWhiteSpace(val))) { // распознаем в первых цифрах до пробела целое 64-битное число. // Если его там нет, записываем в catCode NULL. // Если его удалось распознать, записываем его в catCode. if (!(Int64.TryParse(val.Split(" ")[0], out long cc))) { catCode = null; } else { catCode = cc; } }
Как переписать этот код чуть понятнее?
⏩Как вариант, можно написать что-то в духе:
public static string LeftDigits(this string str) { if (str == null) return null; if (!str.contains(" ") return null; string left = str.Split(" ")[0]; if (! left.All(Char.IsDigit){ return null; } return left; }
With the help of the Search Filters option, users can now filter search results by type. They can do that by using the new tabs: Media, Links, Files and others. Searches can be done based on the particular time period like by typing in the date or even “Yesterday”. If users type in the name of a person, group, channel or bot, an extra filter will be applied to the searches.
What is Telegram?
Telegram’s stand out feature is its encryption scheme that keeps messages and media secure in transit. The scheme is known as MTProto and is based on 256-bit AES encryption, RSA encryption, and Diffie-Hellman key exchange. The result of this complicated and technical-sounding jargon? A messaging service that claims to keep your data safe.Why do we say claims? When dealing with security, you always want to leave room for scrutiny, and a few cryptography experts have criticized the system. Overall, any level of encryption is better than none, but a level of discretion should always be observed with any online connected system, even Telegram.