Convert toChar Method in C#

Chandu yadav
Updated on 23-Jun-2020 07:35:47

1K+ Views

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'

Convert ToDateTime Method in C#

Samual Sam
Updated on 23-Jun-2020 07:35:19

1K+ Views

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

Different Star Pattern Programs in C#

George John
Updated on 23-Jun-2020 07:34:56

25K+ Views

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

Delete Rows in a Table Using JavaScript DOM

Sharon Christine
Updated on 23-Jun-2020 07:33:28

6K+ Views

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                                                                

Create Table Caption with JavaScript DOM

Jai Janardhan
Updated on 23-Jun-2020 07:32:58

597 Views

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                                          

C# Program to Merge Sequences

karthikeya Boyini
Updated on 23-Jun-2020 07:32:51

216 Views

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

Perform Multiline Matching with JavaScript RegExp

Moumita
Updated on 23-Jun-2020 07:32:31

662 Views

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);          

C# Program to Create a Linked List

Arjun Thakur
Updated on 23-Jun-2020 07:32:15

310 Views

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

JavaScript RegExp to Find Alternative Text

Nikitha N
Updated on 23-Jun-2020 07:32:05

237 Views

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);          

C# Program to Invert the Order of Elements in a Sequence

Samual Sam
Updated on 23-Jun-2020 07:31:48

212 Views

Set a string.char[] ch = { 'd', 'r', 'i', 'v', 'e' }; Console.Write("String = foreach(char arr in ch) Console.Write(arr);Now, use Queryable Reverse() method to invert the order of elements.IQueryable res = ch.AsQueryable().Reverse();Let us see the complete code.Example Live Demousing System; using System.Linq; using System.Collections.Generic; public class Demo {    public static void Main() {       char[] ch = { 'd', 'r', 'i', 'v', 'e' };       Console.Write("String = ");       foreach(char arr in ch)       Console.Write(arr);       IQueryable res = ch.AsQueryable().Reverse();       Console.Write("Reversed = ");       foreach (char c in res)       Console.Write(c);    } }OutputString = drive Reversed = evird

Advertisements