- Trending Categories
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
George John has Published 1167 Articles
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
157 Views
Firstly, set the string to be checked.string s = "timetime";Now set two counters for two halves of the string.int []one = new int[MAX_CHAR]; int []two = new int[MAX_CHAR];Check for both the halves of the string.for (int i = 0, j = l - 1; i < j; i++, j--) { ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
56 Views
The BitArray class is used when you need to store the bits but do not know the number of bits in advance.Using the IsReadOnly class, you can get a value indicating whether the BitArray is read-only or not. ReadOnly will not allow you to add new elements to the BitArray.The ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
614 Views
Static ConstructorA static constructor is a constructor declared using static modifier. It is the first block of code executed in a class. With that, a static constructor executes only once in the life cycle of class.Instance ConstructorInstance constructor initializes instance data. Instance constructor is called when an object of class ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
1K+ Views
Enum is Enumeration to store a set of named constants like year, product, month, season, etc.The default value of Enum constants starts from 0 and increments. It has fixed set of constants and can be traversed easily. However you can still change the start index and customize it with the ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
599 Views
To find the equality between enums, use the Equals() method.Let’s say we have the following Enum.enum Products { HardDrive, PenDrive, Keyboard};Create two Products objects and assign the same values.Products prod1 = Products.HardDrive; Products prod2 = Products.HardDrive;Now check for equality using Equals() method. It would be True since both have the ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
181 Views
Quadruple is a tuple with four items.Create a tuple first.var myTuple = Tuple.Create(100, 200, 300, 400);Above, we have created a tuple with four items i.e. Quadruple. Now to access all the four items.myTuple.Item1 myTuple.Item2 myTuple.Item3 myTuple.Item4Example Live Demousing System; public class Program { public static void Main() { ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
255 Views
Pad the end of the string with spaces using the PadRight() method. You can also pad it with a Unicode character.Let’s say the following is our string.string myStr = "Text1";To set a padding at the end of the above string, use the PadRight method.myStr.PadRight(10);Here is the complete example.Example Live Demousing System; ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
990 Views
To get the size of a 3D array in C#, use the GetLength() method with parameter as the index of the dimensions.GetLength(dimensionIndex)To get the size.arr.GetLength(0) arr.GetLength(1) arr.GetLength(2)Example Live Demousing System; class Program { static void Main() { int[, , ] arr = new int[3, 4, 5]; ... Read More
![George John](https://www.tutorialspoint.com/assets/profiles/13511/profile/60_58410-1512537824.png)
George John
2K+ Views
The "D" (or decimal) format specifier works for integer type. It converts a number to a string of decimal digits (0-9).Let’say the following is our number.int val = 467;Now to return the result as 0467, use the following decimal format specifier.val.ToString("D4")Let us see another example.Example Live Demousing System; using System.Globalization; class ... Read More