- 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
TimeSpan Seconds() is part of time, whereas TimeSpan TotalSeconds() converts entire time to seconds.Let us first see the TimeSpan Seconds() method.Example Live Demousing System; using System.Linq; public class Demo { public static void Main() { TimeSpan ts = new TimeSpan(0, 100, 0, 20, 0); // seconds Console.WriteLine(ts.Seconds); } }Output20Now, let us see how TotalSeconds works for the same TimeSpan value.Example Live Demousing System; using System.Linq; public class Demo { public static void Main() { TimeSpan ts = new TimeSpan(0, 100, 0, 20, 0); // ... Read More
The Convert.ToChar method is used to convert a specified value to a Unicode integer.We have declared an sbyte variable.sbyte byteVal = 200;Now, use the Convert.ToChar() method to convert the sbyte value to a Unicode integer.charVal = Convert.ToChar(b);Let us see another example.Example Live Demousing System; public class Demo { public static void Main() { sbyte[] byteVal = { 92, 111, 115 }; char charVal; foreach (sbyte b in byteVal) { charVal = Convert.ToChar(b); Console.WriteLine("{0} converted to '{1}'", b, charVal); } } }Output92 converted to '\' 111 converted to 'o' 115 converted to 's'
The Convert.ToDateTime method converts a given value to a DateTime value.The following is my string.string myDateString; myDateString = "09/09/2018";Now, let us convert it using the Convert.ToDateTime() method.DateTime result; result = Convert.ToDateTime(myDateString);Here is the complete example.Example Live Demousing System; public class Demo { public static void Main() { string myDateString; DateTime result; myDateString = "09/09/2018"; result = Convert.ToDateTime(myDateString); Console.WriteLine("'{0}' converted to {1}", myDateString, result); } }Output'09/09/2018' converted to 9/9/2018 12:00:00 AM
Like any other programming languages such as C, C++, Java, we can easily display start pattern programs in C#.Let us see them one by one.Example Live Demousing System.IO; using System; class Program { static void Main() { for (int i = 1; i
To delete rows in a table in JavaScript, use the DOM deleteRow() method.ExampleYou can try to run the following code to learn how to delete rows in a table. The code deletes rows one at a time −Live Demo function captionFunc(x) { document.getElementById(x).createCaption().innerHTML = "Demo Caption"; } One Two Three Four Five Six
To create a table caption, use the DOM createCaption() method.ExampleYou can try to run the following code to learn how to create table caption −Live Demo function captionFunc(x) { document.getElementById(x).createCaption().innerHTML = "Demo Caption"; } One Two Three Four Five Six
Let’s add two sequences.Integer Array.int[] intArray = { 1, 2, 3, 4, 5, 6, 7, 8 };String Array.string[] stringArray = { "Depp", "Cruise", "Pitt", "Clooney", "Sandler", "Affleck", "Tarantino" };Now to merge both the above sequences, use the Zip method.ntArray.AsQueryable().Zip(stringArray, (one, two) => one + " " + two);Let us see the complete code.Example Live Demousing System; using System.Linq; using System.Collections.Generic; public class Demo { public static void Main() { int[] intArray = { 1, 2, 3, 4, 5, 6, 7, 8 }; string[] stringArray = { "Depp", "Cruise", "Pitt", "Clooney", "Sandler", "Affleck", "Tarantino" ... Read More
To perform multiline matching, use the M modifier available in JavaScript Regular Expression.ExampleYou can try to run the following code to perform multiline matching − JavaScript Regular Expression var myStr = "Welcoming!"; var reg = /^ing/m; var match = myStr.match(reg); document.write(match);
Firstly, set a string array.string [] students = {"Tim","Jack","Henry","David","Tom"};Now, add it to the LinkedList.LinkedList list = new LinkedList(students);The above creates a LinkedList and adds node to it.Let us see the complete example.Example Live Demousing System; using System.Collections.Generic; class Demo { static void Main() { string [] students = {"Tim","Jack","Henry","David","Tom"}; LinkedList list = new LinkedList(students); foreach (var stu in list) { Console.WriteLine(stu); } } }OutputTim Jack Henry David Tom
To match any of the specified alternatives, follow the below-given pattern −(foo|bar|baz)ExampleYou can try to run the following code to find any alternative text − JavaScript Regular Expression var myStr = "one,one,one, two, three, four, four"; var reg = /(one|two|three)/g; var match = myStr.match(reg); document.write(match);