- 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)
733 Views
The Uri.EscapeDataString() method in C# converts a string to its escaped representation.SyntaxFollowing is the syntax −public static string EscapeDataString (string str);Above, the string str is the string to escape.ExampleLet us now see an example to implement the Uri.EscapeDataString() method −using System; public class Demo { public static void Main(){ string URI1 = "https://www.tutorialspoint.com/index.htm"; Console.WriteLine("URI = "+URI1); string URI2 = "https://www.tutorialspoint.com/"; Console.WriteLine("URI = "+URI2); Console.WriteLine("Escaped string (URI1) = "+Uri.EscapeDataString(URI1)); Console.WriteLine("Escaped string (URI2) = "+Uri.EscapeDataString(URI2)); } }OutputThis will produce the following output ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
2K+ Views
The UInt32.ToString() method in C# is used to convert the numeric value of the current UInt32 instance to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString();ExampleLet us now see an example to implement the UInt32.ToString() method −using System; public class Demo { public static void Main(){ uint val1 = 100; uint val2 = 80; Console.WriteLine("Value1 (String representation) = "+val1.ToString()); Console.WriteLine("Value2 (String representation) = "+val2.ToString()); bool res = val1.Equals(val2); Console.WriteLine("Return value (comparison) = "+res); if (res) ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
132 Views
The UInt32.MinValue field in C# represents the minimum value of the 32-bit unsigned integer.SyntaxFollowing is the syntax −public const uint MinValue = 0;ExampleLet us now see an example to implement the UInt32.MinValue field −using System; public class Demo { public static void Main(){ uint val1 = 23; uint val2 = 0; Console.WriteLine("Value1 = "+val1); Console.WriteLine("Value2 = "+val2); Console.WriteLine("HashCode for value1 = "+val1.GetHashCode()); Console.WriteLine("HashCode for value2 = "+val2.GetHashCode()); Console.WriteLine("Are they equal? = "+(val1.Equals(val2))); TypeCode type1 = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
197 Views
The UInt32.MaxValue field in C# represents the maximum value of the 32-bit unsigned integer.SyntaxFollowing is the syntax −public const uint MaxValue = 4294967295;ExampleLet us now see an example to implement the UInt32.MaxValue field −using System; public class Demo { public static void Main(){ uint val1 = 23; uint val2 = 0; Console.WriteLine("Value1 = "+val1); Console.WriteLine("Value2 = "+val2); Console.WriteLine("HashCode for value1 = "+val1.GetHashCode()); Console.WriteLine("HashCode for value2 = "+val2.GetHashCode()); Console.WriteLine("Are they equal? = "+(val1.Equals(val2))); TypeCode type1 = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
58 Views
The UInt32.GetTypeCode() method in C# is used to return the TypeCode for value type UInt32.SyntaxFollowing is the syntax −public TypeCode GetTypeCode ();ExampleLet us now see an example to implement the UInt32.GetTypeCode() method −using System; public class Demo { public static void Main(){ uint val1 = 55; uint val2 = 100; TypeCode type1 = val1.GetTypeCode(); TypeCode type2 = val2.GetTypeCode(); Console.WriteLine("Typecode for val1 = "+type1); Console.WriteLine("Typecode for val2 = "+type2); } }OutputThis will produce the following output −Typecode for val1 = UInt32 ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
88 Views
The Math class in C# has Math.E and Math.PI fields. Let us see an example of both the fields −Math.ESyntaxIt is the natural logarithmic base specified by the constant e. The syntax is as follows −public const double E = 2.71828182845905;ExampleLet us now see an example −using System; public class Demo{ public static void Main(){ double d = Math.E; Console.WriteLine("Math.E = " + d); } }OutputThis will produce the following output −Math.E = 2.71828182845905Math.PIThe Math.PI field represents the ratio of the circumference of a circle to its diameter, specified by the constant, ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
167 Views
The EndsWith() method in C# is used to check whether the ending of the current string instance matches with a specified string or not.SyntaxFollowing is the syntax −public bool EndsWith(string str)Above, the str parameter is the string to be compared.ExampleLet us now see an example to implement the EndsWith() method −using System; public class Demo{ public static void Main(){ bool val; string str = "demo$"; val = str.EndsWith("$"); Console.WriteLine("Return Value = "+val.ToString()); } }OutputThis will produce the following output −Return Value = TrueExampleLet us now see ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
167 Views
The Decimal.ToString() method in C# is used to convert the numeric value of this instance to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString ();ExampleLet us now see an example to implement the Decimal.ToString() method −using System; public class Demo{ public static void Main(){ decimal d = 3444.787m; string str = d.ToString(); Console.WriteLine("String = "+str); } }OutputThis will produce the following output −String = 3444.787ExampleLet us see another example −using System; public class Demo{ public static void Main(){ decimal d = 100; string str = d.ToString(); Console.WriteLine("String = "+str); } }OutputThis will produce the following output −String = 100
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
147 Views
The Double.ToString() method in C# is used to convert the numeric value of this instance to its equivalent string representation.SyntaxFollowing is the syntax −public override string ToString ();ExampleLet us now see an example to implement the Double.ToString() method −using System; public class Demo{ public static void Main(){ double d = 45.7878d; string str = d.ToString(); Console.WriteLine("String = "+str); } }OutputThis will produce the following output −String = 45.7878ExampleLet us now see another example −using System; public class Demo{ public static void Main(){ double d = ... Read More
![AmitDiwan](https://www.tutorialspoint.com/assets/profiles/123055/profile/60_187394-1565938756.jpg)
123 Views
The Console.Clear method in C# is used to clear the console buffer and corresponding console window of display information.SyntaxFollowing is the syntax −public static void Clear ();ExampleLet us now see an example before implementing the Console.Clear method −using System; public class Demo { public static void Main(){ Uri newURI1 = new Uri("https://www.tutorialspoint.com/"); Console.WriteLine("URI = "+newURI1); Console.WriteLine("String representation = "+newURI1.ToString()); Uri newURI2 = new Uri("https://www.tutorialspoint.com/jquery.htm#abcd"); Console.WriteLine("URI = "+newURI2); Console.WriteLine("String representation = "+newURI2.ToString()); if(newURI1.Equals(newURI2)) Console.WriteLine("Both the ... Read More