
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
Samual Sam has Published 2310 Articles

Samual Sam
3K+ Views
The method returns a single specific element of a sequence. If the element is not present in the sequence, then the default value is returned.We have two string arrays here.string[] str1 = { "one" }; string[] str2 = { };First array is checked for a single element, whereas the second ... Read More

Samual Sam
1K+ Views
The following is our list with elements −IList emp = new List() { new Employee() { EmployeeRank = 4, EmpName = "Amit", EmpMarks = 90 } , new Employee() { EmployeeRank = 05, EmpName = "Raman", EmpMarks = 95 } };Now use orderby and descending to sort elements ... Read More

Samual Sam
219 Views
The Full Date Long Time standard format specifier’s custom date and time format string is defined by the current DateTimeFormatInfo.FullDateTimePattern property.The custom format string is −dddd, dd MMMM yyyy HH:mm:ssExample Live Demousing System; using System.Globalization; class Demo { static void Main() { DateTime myDate = new DateTime(2018, ... Read More

Samual Sam
574 Views
Use Select method and Lambda Expression to calculate the cube of elements.The following is our list.List list = new List { 2, 4, 5, 7 };Now, use the Select() method and calculate the cube.list.AsQueryable().Select(c => c * c * c);The following is the entire example.Example Live Demousing System; using System.Linq; using ... Read More

Samual Sam
5K+ Views
To cast a specific type to its IEnumerable equivalent, use the AsEnumerable() method. It is an extension method.The following is our array −int[] arr = new int[5]; arr[0] = 10; arr[1] = 20; arr[2] = 30; arr[3] = 40; arr[4] = 50;Now, get the IEnumerable equivalent.arr.AsEnumerable();Example Live Demousing System; using System.Linq; ... Read More

Samual Sam
2K+ Views
The method matches instances of a pattern and is used to extract value based on a pattern.Let us see hoe to check for a valid URL.For that, pass the regex expression in the Matches method.MatchCollection mc = Regex.Matches(text, expr);Above, the expr is our expression that we have set to check ... Read More

Samual Sam
10K+ Views
To convert a specified value to a double-precision floating-point number, use Convert.ToDouble() method.The following is our long value −long[] val = { 340, -200};Now convert it to Double.double result; result = Convert.ToDouble(val);Example Live Demousing System; public class Demo { public static void Main() { long[] val = ... Read More

Samual Sam
1K+ Views
To return the number of images in a document, use the images property in JavaScript.ExampleYou can try to run the following code to get the count of images −Live Demo var val = document.images.length; document.write("Number of images in the document: "+val);

Samual Sam
5K+ Views
The following is our Dictionary with some elements −Dictionary d = new Dictionary() { {1, "Electronics"}, {2, "Clothing"}, {3, "Toys"}, {4, "Footwear"}, {5, "Accessories"} };Now to display the first element, set the key like this.d[1];The above displays the first element.Example Live Demousing System; using System.Collections.Generic; public ... Read More

Samual Sam
288 Views
The "d" format specifier represents a custom date and time format string.The format string is defined by culture's DateTimeFormatInfo.ShortDatePattern property.The custom format string is −MM/dd/yyyyExample Live Demousing System; using System.Globalization; class Demo { static void Main() { DateTime myDate = new DateTime(2018, 9, 09); ... Read More