Karthikeya Boyini has Published 2383 Articles

Sort the words in lexicographical order in Java

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 14:03:52

2K+ Views

The words are sorted in lexicographical order or dictionary order. This means that the words are alphabetically ordered based on their component alphabets. An example of this is given as follows.The original order of the words is Tom Anne Sally John The lexicographical order of the words is Anne John ... Read More

Java program to print all distinct elements of a given integer array in Java

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:51:31

5K+ Views

All distinct elements of an array are printed i.e. all the elements in the array are printed only once and duplicate elements are not printed. An example of this is given as follows.Array = 1 5 9 1 4 9 6 5 9 7 Distinct elements of above array = ... Read More

Java Program to check whether the character is ASCII 7 bit numeric

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:38:30

142 Views

To check whether the entered value is ASCII 7-bit numeric, check the character from ‘0’ to ‘9’.Here, we have a numeric character.char one = '9';Now, we have checked a condition with if-else for numeric character from ‘0’ to ‘9’if (c >= '0' && c = '0' && c = '0' ... Read More

TypedArray.set() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:36:31

16 Views

The set() function of TypedArray object accepts an array a number representing the index and copies the contents of the specified array in to the current array starting at the given index.SyntaxIts Syntax is as followstypedArray.set()Example Live Demo    JavaScript Array every Method           ... Read More

TypedArray.sort() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:33:45

56 Views

The sort() method of the Typed Array object arranges the elements of the array in ascending order and returns it.SyntaxIts Syntax is as followsarrayBuffer.sort()Example Live Demo    JavaScript Array every Method           var typedArray = new Int32Array([11, 5, 13, 4, 15, 3, 17, 2, ... Read More

TypedArray.subarray() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:32:43

44 Views

The subarray() function of the TypedArray object returns portion of the current array. It accepts two numbers representing the start and end of the sub array.SyntaxIts Syntax is as followstypedArray.subarray(5, 9)Example Live Demo    JavaScript Example           var typedArray = new Int32Array([111, 56, 62, ... Read More

Java program to check for URL in a String

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:31:17

1K+ Views

A program can be created to check if a string is a correct URL or not. An example of an URL is given as follows −String = https://www.wikipedia.org/ The above string is a valid URLA program that demonstrates this is given as follows.Example Live Demoimport java.net.URL; public class Example {   ... Read More

TypedArray.findIndex() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:28:23

21 Views

The find() function of TypedArray accepts a string value representing the name of a function, tests whether the elements in the array passes the test implemented by the provided function, if so, returns the index of the first element which passes the test else, returns -1.SyntaxIts Syntax is as followstypedArray.findIndex(function_name)Example Live ... Read More

TypedArray.includes() function in JavaScript

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:27:01

24 Views

The includes() function of the TypedArray object accepts a value and verifies whether this typed array contains the specified element. If the array contains the given element it returns true else, it returns false.SyntaxIts Syntax is as followstypedArray.includes()Example Live Demo    JavaScript Array every Method       ... Read More

Java Program to remove whitespace from the beginning and end of a string

karthikeya Boyini

karthikeya Boyini

Updated on 25-Jun-2020 13:24:39

315 Views

Use the trim() method to remove whitespace from the beginning and end of a string.Let’s say the following is our string with whitespace.str1 = " The Big Bang Theory ";Now, let us trim all the whitespaces from the beginning and the end.String str2 = str1.trim();The following is the final example ... Read More

Advertisements