- 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
Found 2628 Articles for Csharp
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
69 Views
The CharEnumerator.Reset() method in C# initializes the index to a position logically before the first character of the enumerated string.Syntaxpublic void Reset ();ExampleLet us now see an example to implement the CharEnumerator.Reset() method −using System; public class Demo { public static void Main(){ string strNum = "This is it!"; CharEnumerator ch = strNum.GetEnumerator(); Console.WriteLine("HashCode = "+ch.GetHashCode()); Console.WriteLine("Get the Type = "+ch.GetType()); while (ch.MoveNext()) Console.Write(ch.Current + " "); ch.Reset(); Console.WriteLine(); while (ch.MoveNext()) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
309 Views
The CharEnumerator.MoveNext() method in C# is used to increments the internal index of the current CharEnumerator object to the next character of the enumerated string.Syntaxpublic bool MoveNext ();Let us now see an example to implement the CharEnumerator.MoveNext() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "john"; CharEnumerator ch = strNum.GetEnumerator(); Console.WriteLine("HashCode = "+ch.GetHashCode()); Console.WriteLine("Get the Type = "+ch.GetType()); while (ch.MoveNext()) Console.Write(ch.Current + " "); // disposed ch.Dispose(); ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
25 Views
The CharEnumerator.GetType() method in C# is used to get the type of the current instance.Syntaxpublic Type GetType();Let us now see an example to implement the CharEnumerator.GetType() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "john"; CharEnumerator ch = strNum.GetEnumerator(); Console.WriteLine("HashCode = "+ch.GetHashCode()); Console.WriteLine("Get the Type = "+ch.GetType()); while (ch.MoveNext()) Console.Write(ch.Current + " "); // disposed ch.Dispose(); // this will show an error since we disposed ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
26 Views
The CharEnumerator.GetHashCode() method in C# returns a hash code for the current object.Syntaxpublic virtual int GetHashCode ();Let us now see an example to implement the CharEnumerator.GetHashCode() method −Exampleusing System; public class Demo { public static void Main(){ string strNum = "john"; CharEnumerator ch = strNum.GetEnumerator(); Console.WriteLine("HashCode = "+ch.GetHashCode()); 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 −HashCode = 30571253 j o h n
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
295 Views
The Dictionary. Count property in C# gets the number of key/value pairs in the Dictionary.syntaxpublic int Count { get; }Let us now see an example to implement the Dictionary. Count property −Exampleusing System; using System.Collections.Generic; public class Demo { public static void Main(){ Dictionary dict = new Dictionary(); dict.Add("One", "Chris"); dict.Add("Two", "Steve"); dict.Add("Three", "Messi"); dict.Add("Four", "Ryan"); dict.Add("Five", "Nathan"); Console.WriteLine("Count of elements = "+dict.Count); Console.WriteLine("Key/value pairs..."); foreach(KeyValuePair res in dict){ ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
286 Views
The Char.TryParse() method in C# is used to convert the value of the specified string to its equivalent Unicode character.Syntaxpublic static bool TryParse (string str, out char res);Let us now see an example to implement the Char.TryParse () method −Exampleusing System; public class Demo { public static void Main(){ bool res; Char ch; res = Char.TryParse("10", out ch); Console.WriteLine(res); Console.WriteLine(ch.ToString()); } }OutputThis will produce the following output −FalseLet us now see another example −Exampleusing System; public class Demo { public static void ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
128 Views
The Char.ToUpperInvariant() method in C# is used to convert the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture.Syntaxpublic static char ToUpperInvariant (char ch);Above, the parameter ch is the Unicode character to convert.Let us now see an example to implement the Char.ToUpperInvariant() method −Exampleusing System; public class Demo { public static void Main(){ char ch = 'q'; char res = Char.ToUpperInvariant(ch); Console.WriteLine("Value = "+ch); Console.WriteLine("Uppercase Equivalent = "+res); } }OutputThis will produce the following output −Value = q ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
252 Views
The Math.Log10() method in C# is returned to the base 10 logarithms of a specified number.Syntaxpublic static double Log10 (double val);Here, Val is the number whose logarithm we want.The Log10() method returns −Val parameterReturnsPositiveThe base 10 log of d; that is, log 10d.ZeroNegativeInfinityNegativeNaNEqual to NaNNaNEqual to PositiveInfinityPositiveInfinityLet us now see an example to implement Math.Log10() method −Exampleusing System; public class Demo { public static void Main(){ double val1 = Double.PositiveInfinity; ; double val2 = Double.NegativeInfinity; Console.WriteLine(Math.Log10(val1)); Console.WriteLine(Math.Log10(val2)); } }OutputThis will produce the following output −∞ NaNLet ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
535 Views
The Math.Log() method in C# is used to return the logarithm of a specified number.Syntaxpublic static double Log(double num) public static double Log(double num, double base)Above, num is the specified number whose logarithm is to be calculated. Here, the base is the base of the logarithm.Let us now see an example to implement the Math.Log() method −Exampleusing System; public class Demo { public static void Main(){ double val1 = 2.15; double val2 = -2.15; Console.WriteLine(Math.Log(val1)); Console.WriteLine(Math.Log(val2)); } }OutputThis will produce the following output −0.765467842139571 NaNExampleLet us ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
42 Views
The Math.IEEERemainder() method in C# is used to return the remainder resulting from the division of a specified number by another specified number.Syntaxpublic static double IEEERemainder (double dividend, double divisor);Let us now see an example to implement Math.IEEERemainder() method −Exampleusing System; public class Demo { public static void Main(){ double val1 = 90; double val2 = 7; // IEEE Remainder var rem = Math.IEEERemainder(val1, val2); Console.WriteLine(rem); } }OutputThis will produce the following output −-1Let us see another example to implement Math.IEEERemainder() method −Exampleusing ... Read More