Your questions: Q1: What is the difference between String and string in C# ? Example (note the case): string s = "Hello world!"; String s = "Hello world!"; What are the guidelines for the use of each? And what are the differences? Answer: string is an alias in C# for System.String So technically,there is no difference.Its like int vs. System.Int32. As far as guidelines, its generally recommended to use string any time youre referring to an object. e.g: string greet = String.Format("Hello {0}!", place); This is the style that Microsoft tends to use in their examples. it appears that the guidance in this area may have changed, as StyleCop now enforces the use of the C# specific aliases. Q2: How to enumerate an enum? Answer: foreach (Suit suit in (Suit[]) Enum.GetValues(typeof(Suit))) { } Note: The cast to (Suit[]) is not strictly necessary, but it does make the code 0.5 ns faster. If you have any questions just ask me. #programming #codinglife #programmersquestions #ask #programmers #code #developers #developer #csharp #programmer #coder #askquestions #questions #hosseinkhoshbayan #programmerslife #coders #yourquestionsanswered #csharpprogramming #string #int #enum #suit https://www.instagram.com/p/B-40RJoF8Ks/?igshid=1h0sqs2b7rfuk












