AmitDiwan has Published 9818 Articles

HTML DOM Table rows Collection

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:55:43

412 Views

The HTML DOM table rows Collection returns a collection of all elements of a table in an HTML document.SyntaxFollowing is the syntax −object.rowsProperties of rows Collectionelements in the collection in an HTML document.PropertyExplanationlengthIt returns the number of elements in the collection in an HTML document.Methods of rows Collectionelement ... Read More

HTML DOM Table deleteRow() Method

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:44:25

162 Views

The HTML DOM table deleteRow() method deletes a element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteRow(index)Here, index represent a number that specifies the position of the row to delete.Let us see an example of HTML DOM table deleteRow() method −Example Live Demo    body ... Read More

HTML DOM Table deleteTHead() Method

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:40:50

122 Views

The HTML DOM table deleteTHead() method delete the element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteTHead()Let us see an example of HTML DOM table deleteTHead() method −Example Live Demo    body {       color: #000;       background: lightblue;     ... Read More

Check if a string contains only alphabets in Java using ASCII values

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:29:26

522 Views

Let’s say we have set out inut string in myStr variable. Now loop through until the length of string and check for alphabets with ASCII values −for (int i = 0; i < myStr.length(); i++) {    char c = myStr.charAt(i);    if (!(c >= 'A' && c = 'a' && c = 'A' && c = 'a' && c

Check if a string contains only alphabets in Java using Regex

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:24:32

1K+ Views

At first, convert the string into character array. Here, name is our string −char[] ch = name.toCharArray();Now, loop through and find whether the string contains only alphabets or not. Here, we are checking for not equal to a letter for every character in the string −for (char c : ch) { ... Read More

Check if a string contains only alphabets in Java using Lambda expression

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 08:19:04

821 Views

Let’s say our string is −String str = "Amit123";Now, using allMatch() method, get the boolean result whether the string has only alphabets or now −boolean result = str.chars().allMatch(Character::isLetter);Following is an example to check if a string contains only alphabets using Lambda Expressions −Exampleclass Main {    public static void main(String[] ... Read More

How to sort an ArrayList in Descending Order in Java

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 07:42:31

695 Views

To sort an ArrayList, you need to use the Collections.sort() method. This sorts in ascending order, but if you want to sort the ArrayList in descending order, use the Collections.reverseOrder() method as well. This gets included as a parameter −Collections.sort(myList, Collections.reverseOrder());Following is the code to sort an ArrayList in descending ... Read More

How to sort HashSet in Java

AmitDiwan

AmitDiwan

Updated on 20-Sep-2019 07:15:36

2K+ Views

To sort HashSet in Java, you can use another class, which is TreeSet.Following is the code to sort HashSet in Java −Example Live Demoimport java.util.*; public class Main {    public static void main(String args[]) {       Set hashSet = new HashSet();       hashSet.add("green");       ... Read More

HTML DOM Table deleteTFoot() Method

AmitDiwan

AmitDiwan

Updated on 19-Sep-2019 13:38:33

106 Views

The HTML DOM table deleteTFoot() method delete the element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteTFoot()Let us see an example of HTML DOM table deleteTFoot() method −Example Live Demo    body {       color: #000;       background: lightblue;     ... Read More

HTML DOM Table deleteCaption() Method

AmitDiwan

AmitDiwan

Updated on 19-Sep-2019 13:35:04

107 Views

The HTML DOM table deleteCaption() method delete the first element from the table in an HTML document.SyntaxFollowing is the syntax −object.deleteCaption()Let us see an example of HTML DOM table deleteCaption() method −Example Live Demo    body {       color: #000;       background: lightblue;   ... Read More

Advertisements