π Top 15 Udemy Courses (80-90% Discount): My Udemy Courses - Ramesh Fadatare — All my Udemy courses are real-time and project oriented courses.
▶️ Subscribe to My YouTube Channel (178K+ subscribers): Java Guides on YouTube
▶️ For AI, ChatGPT, Web, Tech, and Generative AI, subscribe to another channel: Ramesh Fadatare on YouTube
1. How do you concatenate strings in C#?
Answer:
Explanation:
In C#, strings are commonly concatenated using the '+' operator.
2. What method is used to compare two strings for equality in C#?
Answer:
Explanation:
The equals() method is used to compare two strings for equality in C#.
3. Which method in the String class returns the length of a string in C#?
Answer:
Explanation:
The Length property of the String class is used to get the length of a string in C#.
4. How can you convert a string to uppercase in C#?
Answer:
Explanation:
The ToUpper() method is used to convert a string to uppercase in C#.
5. What is the output of the following code in C#?
Answer:
Explanation:
The Substring(7) method returns a new string starting from the 7th index of the original string.
6. What is the character used to denote a verbatim string in C#?
Answer:
Explanation:
In C#, the '@' character is used before a string literal to denote a verbatim string.
7. How do you split a string on specific characters in C#?
Answer:
Explanation:
The Split() method is used to split a string into an array of substrings based on specific characters.
8. What does the Trim() method do in C#?
Answer:
Explanation:
The Trim() method is used to remove all leading and trailing white-space characters from a string.
9. How do you determine if a string starts with a specific substring in C#?
Answer:
Explanation:
The StartsWith() method is used to check if a string starts with a specific substring.
10. What is the result of string concatenation using the following code in C#?
Answer:
Explanation:
The '+' operator is used to concatenate strings with a space in between.
11. How do you find the position of a substring within a string in C#?
Answer:
Explanation:
The IndexOf() method is used to find the position of a substring within a string.
12. Which method is used to replace a specified substring with another substring in a string in C#?
Answer:
Explanation:
The Replace() method is used to replace all occurrences of a specified substring with another substring in a string.
13. What is the output of the following code in C#?
Answer:
Explanation:
String indexing in C# is zero-based, so text[2] refers to the third character, which is 'h'.
14. How do you convert a string to a number in C#?
Answer:
Explanation:
Both int.Parse() and Convert.ToInt32() methods can be used to convert a string to a number.
15. What does the IsNullOrEmpty method do in C#?
Answer:
Explanation:
The IsNullOrEmpty method checks whether a string is null or its length is zero.
16. How do you format a string in C# using placeholders?
Answer:
Explanation:
Both the String.Format() method and string interpolation can be used to format strings using placeholders in C#.
17. What is the escape sequence used for a new line in C#?
Answer:
Explanation:
The '\n' escape sequence is used to represent a new line in C#.
18. How can you check if a string contains a specific substring in C#?
Answer:
Explanation:
The Contains() method is used to check if a string contains a specific substring.
My Top and Bestseller Udemy Courses. The sale is going on with a 70 - 80% discount. The discount coupon has been added to each course below:
Build REST APIs with Spring Boot 4, Spring Security 7, and JWT
[NEW] Learn Apache Maven with IntelliJ IDEA and Java 25
ChatGPT + Generative AI + Prompt Engineering for Beginners
Spring 7 and Spring Boot 4 for Beginners (Includes 8 Projects)
Available in Udemy for Business
Building Real-Time REST APIs with Spring Boot - Blog App
Available in Udemy for Business
Building Microservices with Spring Boot and Spring Cloud
Available in Udemy for Business
Java Full-Stack Developer Course with Spring Boot and React JS
Available in Udemy for Business
Build 5 Spring Boot Projects with Java: Line-by-Line Coding
Testing Spring Boot Application with JUnit and Mockito
Available in Udemy for Business
Spring Boot Thymeleaf Real-Time Web Application - Blog App
Available in Udemy for Business
Master Spring Data JPA with Hibernate
Available in Udemy for Business
Spring Boot + Apache Kafka Course - The Practical Guide
Available in Udemy for Business
Comments
Post a Comment
Leave Comment