Karthikeya Boyini has Published 2383 Articles

Bootstrap .has-error class

karthikeya Boyini

karthikeya Boyini

Updated on 12-Jun-2020 13:52:44

2K+ Views

The has-error class allows you to set error for input.You can try to run the following code to implement the has-error classExampleLive Demo           Bootstrap Example                                                                      Input with error                                                                        

Checkbox-inline Bootstrap class

karthikeya Boyini

karthikeya Boyini

Updated on 12-Jun-2020 13:43:03

428 Views

Use .checkbox-inline class to a series of checkboxes for controls to appear on the same line.You can try to run the following code to implement the .checkbox-inline classExampleLive Demo           Bootstrap Forms                                       Best IDE (You can select more than one)                             NetBeans IDE                                 Eclipse IDE                    

Bootstrap Horizontal Form

karthikeya Boyini

karthikeya Boyini

Updated on 12-Jun-2020 13:20:13

2K+ Views

To create a horizontal form in Bootstrap, follow the below steps − Add a class of .form-horizontal to the parent element. Wrap labels and controls in a with class .form-group. Add a class of .control-label to the labels.You can try to run the following code to create a horizontal form in ... Read More

HTML5 Input type “number” in Firefox

karthikeya Boyini

karthikeya Boyini

Updated on 04-Jun-2020 09:35:44

625 Views

The min attribute of the input type number isn’t supported by Firefox, but it works correctly in Google Chrome.ExampleLet us see an example −           HTML input number                        Mention any number between 1 to 10                              

Understanding IndexOutOfRangeException Exception in C#

karthikeya Boyini

karthikeya Boyini

Updated on 13-Apr-2020 12:31:00

114 Views

It occurs when Index is outside the bounds of the array.Let us see an example. We have declare an array with 5 elements and set the size as 5.int[] arr = new int[5]; arr[0] = 10; arr[1] = 20; arr[2] = 30; arr[3] = 40; arr[4] = 50;Now, we try ... Read More

C# Program to read all the lines of a file at once

karthikeya Boyini

karthikeya Boyini

Updated on 10-Apr-2020 09:42:53

144 Views

Use ReadAllText() method to read all the lines of a file at once.Let’s say we have a file “hello.txt” with the following lines −One Two ThreeTo read the above file, add the path of the file as parameter.File.ReadAllText(myPath);Above, myPath had the file path.String myPath = "hello.txt";Let us see the complete ... Read More

Read in a file in C# with StreamReader

karthikeya Boyini

karthikeya Boyini

Updated on 03-Apr-2020 10:43:20

430 Views

To read text files, use StreamReader class in C#.Add the name of the file you want to read −StreamReader sr = new StreamReader("hello.txt");Use the ReadLine() method and get the content of the file in a string −using (StreamReader sr = new StreamReader("hello.txt")) {    str = sr.ReadLine(); } Console.WriteLine(str);Let us ... Read More

How to access array elements using a pointer in C#?

karthikeya Boyini

karthikeya Boyini

Updated on 03-Apr-2020 09:08:18

3K+ Views

In C#, an array name and a pointer to a data type same as the array data, are not the same variable type. For example, int *p and int[] p, are not the same type. You can increment the pointer variable p because it is not fixed in memory but ... Read More

Print a 2 D Array or Matrix in C#

karthikeya Boyini

karthikeya Boyini

Updated on 27-Mar-2020 10:08:56

2K+ Views

First, set a two-dimensional array.int[, ] arr = new int[10, 10];Now, get the elements from the user −for (i = 0; i < m; i++) {    for (j = 0; j < n; j++) {       arr[i, j] = Convert.ToInt16(Console.ReadLine());    } }Let us see the complete ... Read More

String Join() method

karthikeya Boyini

karthikeya Boyini

Updated on 27-Mar-2020 09:40:42

493 Views

The Join () method in strings concatenates all the elements of a string array, using the specified separator between each element.In the below example we have a multi-line string and we have set the separator as “” −String.Join("", starray);ExampleThe following is the complete example − Live Demousing System; namespace StringApplication ... Read More

Advertisements