
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Found 2587 Articles for Csharp

2K+ Views
The Math.DivRem() method in C# is used to divide and calculate the quotient of two numbers and also returns the remainder in an output parameter.Syntaxpublic static int DivRem (int dividend, int divisor, out int remainder); public static long DivRem (long dividend, long divisor, long remainder);Let us now see an example to implement Math.DivRem() method −Exampleusing System; public class Demo { public static void Main(){ int dividend = 30; int divisor = 7; int remainder; int quotient = Math.DivRem(dividend, divisor, out remainder); Console.WriteLine("Quotient = "+quotient); ... Read More

472 Views
The Char.IsWhiteSpace() method in C# is used to indicate whether the specified Unicode character is white space.Syntaxpublic static bool IsWhiteSpace (char ch);Above, the parameter ch is the Unicode character to evaluate.Let us now see an example to implement the Char.IsWhiteSpace() method −Exampleusing System; public class Demo { public static void Main(){ bool res; char val = ' '; Console.WriteLine("Value = "+val); res = Char.IsWhiteSpace(val); Console.WriteLine("Is the value whitespace? = "+res); } }OutputThis will produce the following output −Value = Is the value whitespace? ... Read More

2K+ Views
The Dictionary.Clear() method in C# removes all key/value pairs from the Dictionary.Syntaxpublic void Clear();Let us now see an example to implement the Dictionary.Clear() method −Exampleusing System; using System.Collections.Generic; public class Demo { public static void Main(){ Dictionary dict = new Dictionary(); dict.Add("One", "John"); dict.Add("Two", "Tom"); dict.Add("Three", "Jacob"); dict.Add("Four", "Kevin"); dict.Add("Five", "Nathan"); Console.WriteLine("Count of elements = "+dict.Count); Console.WriteLine("Key/value pairs..."); foreach(KeyValuePair res in dict){ Console.WriteLine("Key = {0}, ... Read More

126 Views
The CharEnumerator.Dispose() method in C# is used to release all resources used by the current instance of the CharEnumerator class.Syntaxpublic void Dispose ();Let us now see an example to implement the CharEnumerator.Dispose() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "356"; CharEnumerator ch = strNum.GetEnumerator(); while (ch.MoveNext()) Console.Write(ch.Current + " "); // disposed ch.Dispose(); // this will show an error since we disposed the object above // Console.WriteLine(ch.Current); } }OutputThis will produce the following output −3 5 6

105 Views
The CharEnumerator.Clone() method in C# is used to create a copy of the current CharEnumerator object.Syntaxpublic object Clone();Let us now see an example to implement the CharEnumerator.Clone() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "356"; CharEnumerator ch = strNum.GetEnumerator(); while (ch.MoveNext()){ Console.Write(ch.Current + " "); CharEnumerator enumClone = (CharEnumerator)ch.Clone(); while (enumClone.MoveNext()) Console.Write(enumClone.Current + " "); Console.WriteLine(); } } }OutputThis will produce the following output −3 5 6 5 6 6

2K+ Views
The Char.IsUpper() method in C# indicates whether the specified Unicode character is categorized as an uppercase letter.Syntaxpublic static bool IsUpper (char ch);Above, the parameter ch is the Unicode character to evaluate.Let us now see an example to implement the Char.IsUpper() method −Exampleusing System; public class Demo { public static void Main(){ bool res; char val = 'H'; Console.WriteLine("Value = "+val); res = Char.IsUpper(val); Console.WriteLine("Is the value an uppercae letter? = "+res); } }OutputThis will produce the following output −Value = H Is the ... Read More

541 Views
The Char.IsSymbol() method in C# is indicating whether the character at the specified position in a specified string is categorized as a symbol character.Syntaxpublic static bool IsSymbol (string str, int index);Above, str is a string, whereas the position of the character to evaluate in str.Let us now see an example to implement the Char.IsSymbol() method −Exampleusing System; public class Demo { public static void Main(){ bool res; char val = 'P'; Console.WriteLine("Value = "+val); res = Char.IsSymbol(val); Console.WriteLine("Is the value a symbol? = "+res); ... Read More

523 Views
The Char.IsControl(String, Int32) method in C# is used to indicate whether the character at the specified position in a specified string is categorized as a control character.Syntaxpublic static bool IsControl (string str, int index);Above, str is a string. The index parameter is the position of the character to evaluate in str.Let us now see an example to implement the Char.IsControl(String, Int32) method −Exampleusing System; using System.Globalization; public class Demo { public static void Main(){ string val = "hjk9878hj"; Console.WriteLine("String = "+val); UnicodeCategory unicode = Char.GetUnicodeCategory(val, 4); Console.WriteLine("The ... Read More

4K+ Views
The Dictionary.ContainsValue() method in C# is used to check whether the Dictionary contains a specific value or not.Syntaxpublic bool ContainsValue (TValue val);Above, Val is the value to be searched.Let us now see an example to implement the Dictionary.ContainsValue() method −Exampleusing System; using System.Collections.Generic; public class Demo { public static void Main(){ Dictionary dict = new Dictionary(); dict.Add("One", "John"); dict.Add("Two", "Tom"); dict.Add("Three", "Jacob"); dict.Add("Four", "Kevin"); dict.Add("Five", "Nathan"); Console.WriteLine("Count of elements = "+dict.Count); Console.WriteLine("Key/value ... Read More