Pranay Arora

Pranay Arora

36 Articles Published

Articles by Pranay Arora

Page 4 of 4

Insert a character after every n characters in JavaScript

Pranay Arora
Pranay Arora
Updated on 15-Mar-2026 5K+ Views

Insertion of a specific character after every n characters in JavaScript is an easy-to-understand concept that gives us better understanding of JavaScript's string manipulation functions. Here n can be any whole number ranging from 1 to less than the length of the string. In this article, we'll explore different methods to insert a "-" character after every 5 characters in a string. Method 1: Using the slice() Method The slice() method extracts a portion of a string and returns a new string. It accepts two parameters: the starting index and the ending index (exclusive). let ...

Read More

Java program to demonstrate the call by value

Pranay Arora
Pranay Arora
Updated on 11-Nov-2024 1K+ Views

In programming, functions often require parameters to be passed to them to be called or invoked. There are 2 ways to call functions, the 1st being call by Reference and the 2nd being call by value. In this article, we are going to demonstrate call by value in Java. Call by value is a method in which the value of the argument is passed as a copy to the function, hence any change made to this argument inside the function will not affect the original value of the argument beyond the scope of this function. To help understand these concepts ...

Read More

Java program to display Floyd\'s triangle

Pranay Arora
Pranay Arora
Updated on 18-Oct-2024 1K+ Views

In this article, we are going to see how to display Floyd’s Triangle using Java. Floyd's triangle is a popular right-angled triangular array consisting of natural numbers. It is formed by starting with the number 1 at the top of the triangle, and then incrementing each subsequent number by 1 as you move down the rows of the triangle. The first row contains only 1 number which is 1 itself and each subsequent row contains 1 more number than the previous row. The triangle has n rows where n can be any positive whole number. The total number of values in ...

Read More

Java program to extract a single quote enclosed string from a larger string using Regex

Pranay Arora
Pranay Arora
Updated on 16-Sep-2024 1K+ Views

Regex or Regular Expression is the language used for pattern-matching and string manipulation. It consists of a sequence of characters that define a search pattern and can be used for performing actions like search, replace, and even validate on text input. A regular expression consists of a series of characters and symbols that amount to form a search pattern. In this article, we are going to see how to write a Java program to extract a single quote-enclosed string from a larger string using Regex. Java provides support for regex from the java.util.regex package. The pattern class represents a compiled ...

Read More

Java Program to Demonstrate How User Authentication is Done

Pranay Arora
Pranay Arora
Updated on 06-Apr-2023 3K+ Views

Authentication refers to the process of verifying the identity of an individual to make sure the user is exactly who they are claiming to be before giving access to a system. It is very important to authenticate a user to ensure the security as well as integrity of the system. Over the course of time, authentication has developed into much more advanced and secure methods. The methods of authentication now range from credentials like user id, password and OTP to finger print scan, face ID scan and much more. Authentication ensures that no sensitive resources are being shared with unauthorised ...

Read More

Java Program to Encode a Message Using Playfair Cipher

Pranay Arora
Pranay Arora
Updated on 10-Mar-2023 3K+ Views

Encrypting is the task of transforming information into an unreadable format or cipher text. It is usually done to protect the confidentiality of information. There are many ways and algorithms to encrypt data. One such example is the Playfair cipher algorithm. In this article, we are going to see how to write a Java program to encode a message using Playfair cipher. Playfair cipher makes use of a 5X5 grid or matrix and a set of pre-defined rules. To encrypt, we require a key and the plain text to be encrypted. Steps Now let us see the steps to encrypt ...

Read More
Showing 31–36 of 36 articles
« Prev 1 2 3 4 Next »
Advertisements