- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
char vs string keywords in C#
string keyword
Use the string keyword to declare a string variable. The string keyword is an alias for the System.String class.
For example.
string name; name = "Tom Hanks";
Another example.
string [] array={ "Hello", "From", "Tutorials", "Point" };
char keyword
The char keyword is used to set array of characters.
For example.
char[] ch = new char[2]; ch[0] = 'A'; // Character literal ch[1] = 'B'; // Character literal
Another example.
char []letters= { 'H', 'e', 'l', 'l','o' };
Advertisements