C# 1001 notes
6.51K subscribers
329 photos
9 videos
2 files
313 links
Регулярные короткие заметки по C# и .NET.

Просто о сложном для каждого.

admin - @haarrp
加入频道
What will be the output of the following program?
Anonymous Quiz
33%
100
3%
0
58%
Compile-time error
6%
Runtime error
#post

In this post, I'd like to have a look into minimal APIs.

With the preview 4, Microsoft simplified the simplest project template to an absolute minimum. Microsoft created this template to make it easier for new developers to start creating small microservices and HTTP APIs.

Read more...
#challenge

💻 Check if a Number is Prime | #easy

Create a function that returns true if a number is prime, and false otherwise. A prime number is any positive integer that is evenly divisible by only two divisors: 1 and itself.

The first ten prime numbers are: 2, 3, 5, 7, 11, 13, 17, 19, 23, 29

Examples:

isPrime(31) ➞ true
isPrime(18) ➞ false
isPrime(11) ➞ true

For your convenience: dotnetfiddle.

🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇

#interview
Here is a solution for the #challenge above
Which of the following data type should be used for monetary value?
Anonymous Quiz
5%
Long
8%
Float
15%
Double
71%
Decimal
#book

Программируем на C# 8.0
Гриффитс И.

C# — универсальный язык, который может практически всё! Иэн Гриффитс рассказывает о его возможностях с точки зрения разработчика, перед которым стоит задача быстро и эффективно создавать приложения любой сложности.

Множество примеров кода научат работать с шаблонами, LINQ и асинхронными возможностями языка. Вы разберетесь с асинхронными потоками, ссылочными типами, допускающими значение NULL, сопоставлениями с образцом, реализациями по умолчанию для метода интерфейса, диапазонами и синтаксисом индексации и многим другим.

Скачать книгу
What will be the output of the following program?
Anonymous Quiz
9%
210
54%
210.12
30%
Compile-time error
7%
Runtime error
#post

Now, for the final post in this mini-series, let's turn our attention to a feature that was originally scheduled for release in C# 10, but didn't quite make the cut: required properties.

Read more...
#challenge

💻 Capitalize the First Letter of Each Word | #easy

Create a function that takes a string as an argument and converts the first character of each word to uppercase. Return the newly formatted string.

Examples:

MakeTitle("This is a title") ➞ "This Is A Title"
MakeTitle("capitalize every word") ➞ "Capitalize Every Word"
MakeTitle("I Like Pizza") ➞ "I Like Pizza"
MakeTitle("PIZZA PIZZA PIZZA") ➞ "PIZZA PIZZA PIZZA"

For your convenience: dotnetfiddle.

🏆 Leave your solutions in the comments. The solution will be posted below in a couple of hours 👇

#interview
Here is a solution for the #challenge above
C# 1001 notes
Here is a solution for the #challenge above
💬 Actually, I vote for this solution to this #challenge instead.

Thx to Roman!
Have a great weekend and perfect first code 😉
📝 What is the difference between continue and break statements in C#?

🔸 using break statement, you can jump out of a loop

🔸 using continue statement, you can jump over one iteration and then resume your loop execution

#post