Found 34475 Articles for Programming

Tesseract OCR with Java with Examples

Sabid Ansari
Updated on 16-Jun-2023 14:09:52

4K+ Views

Introduction Optical Character Recognition (OCR) plays an instrumental role in digitizing printed text, allowing it to be edited, searched, and stored more compactly. One of the most powerful OCR tools available is Tesseract OCR. This article will explore how to use Tesseract OCR with Java, providing detailed examples to enhance your understanding. What is Tesseract OCR? Tesseract OCR is an open-source OCR engine sponsored by Google that can recognize more than 100 languages out of the box. It's widely regarded for its accuracy and adaptability, making it a popular choice for developers across various applications. Integrating Tesseract OCR with Java ... Read More

Swift program to generate an OTP

Ankita Saini
Updated on 15-Jun-2023 16:16:30

331 Views

An OTP is known as a one-time password. It is an automatically generated random numeric string which is used for a single login session or transaction on digital devices. It is generally used to enhance security by providing extra authentication. For example, “423193”, “489201’, etc. To generate OTP Swift provides the following methods − Using random() method Using randomElement() method Method 1: Using random() method As we know that OTP is a randomly generated string. So to generate a random string Swift provide an inbuilt function named as random(). It is used to create a random string of ... Read More

Swift program to generate a password

Ankita Saini
Updated on 15-Jun-2023 16:35:50

413 Views

A password is a combination of various characters of a specified length and is used to authenticate or gain access to the system or login to an account. It is designed for security purposes and ensures that only an authorized user can access or log in to the specific account. It is important to select a strong password so that other people cannot crack it. It is generated according to the following conditions − Contains at least one uppercase letter. Contains at least one lowercase letter. Contains at least one number. Length must be 8 characters Contains at ... Read More

Swift program to find the longest word in a string

Ankita Saini
Updated on 15-Jun-2023 17:03:32

454 Views

In Swift, a string is a sequence of characters. So a string can contain small and larger words. Hence using the following methods we can find the largest word in the string. Using component() method Using user-defined method Example Input String: "Rabbit run fast" Output String: "Rabbit" Here, the largest word among all the given words in the string is “Rabbit”. Method 1: Using component() method The components() method is used to create an array of substrings from the given string, where each substring is separated by the specified separator. So here we use the components(separatedBy:.whitespaces) method ... Read More

Swift program to Convert Fahrenheit to Celsius

Ankita Saini
Updated on 16-Jun-2023 11:23:45

495 Views

Fahrenheit is the commonly used temperature-measuring unit. In this scale, the freezing point and boiling point of the water are 32 degrees and 212 degrees. Whereas Celsius is also a temperature-measuring scale. In the Celsius scale, the freezing point and the boiling point of the water are 0 degrees and 100 degrees. So in Swift, we can convert Fahrenheit to Celsius using the following methods − Using Formula Using converted() method Method 1: Using Formula We can easily convert Fahrenheit to Celsius using the mathematical formula. It is the easiest way to convert Fahrenheit to Celsius. ... Read More

Swift program to Convert Celsius to Fahrenheit

Ankita Saini
Updated on 16-Jun-2023 11:31:14

700 Views

Fahrenheit is the commonly used temperature-measuring unit. In this scale, the freezing point and boiling point of the water are 32 degrees and 212 degrees. Whereas Celsius is also a temperature-measuring scale. In the Celsius scale, the freezing point and the boiling point of the water are 0 degrees and 100 degrees. So in Swift, we can convert Celsius to Fahrenheit using the following methods − Using Formula Using converted() method Method 1: Using Formula We can easily convert Celsius to Fahrenheit using the mathematical formula. It is the easiest way to convert Celsius to Fahrenheit. Syntax ... Read More

Swift Program to Use Different Types of a Collection

Ankita Saini
Updated on 16-Jun-2023 12:28:26

125 Views

A collection is a group of elements or objects that are gathered together for some specific tasks. Swift supports three types of collections: Array, Set, and Dictionary. They are implemented as generic collections, also they are clear about what type of values they can store which means you can not store the wrong type of values in the collections. Array It is an ordered collection which is used to store similar types of data or elements. It can store duplicate values. It is both mutable and immutable. Syntax var arr :[Type] = [E1, E2, E3] var arr = ... Read More

Swift Program to trim a string from the right side

Ankita Saini
Updated on 16-Jun-2023 11:51:25

126 Views

In Swift, we can adjust the size of the string by trimming some specified number of characters from the right-hand side of the given string. Or we can also trim the extra whitespaces which we do not want on the right-hand side of the given string using the following methods − Method 1: Trim a string from the right side To trim a specified number of characters or a substring from the right side of the string we create a user-defined function which takes an input string and the length of the characters which we wanted to remove ... Read More

Swift Program to trim a string from the left side

Ankita Saini
Updated on 16-Jun-2023 11:56:18

177 Views

In Swift, we can adjust the size of the string by trimming some specified number of characters from the left side of the string. Or we can also trim the extra whitespaces which we do not want on the left side of the original string using the following methods. Method 1: Trim a string from the left side To trim a specified number of characters or a substring from the left side of the string we create a user-defined function which takes an input string and the length of the characters which we wanted to remove from the left side ... Read More

Swift Program to trim a string from both sides

Ankita Saini
Updated on 16-Jun-2023 12:01:35

214 Views

In Swift, we can adjust the size of the string by trimming some specified number of characters from both sides of the string. Or we can also trim the extra whitespaces which we do not want from both sides of the original string using the following methods. Method 1: Trim a string from the both sides To trim a specified number of characters or a substring from both sides of the string we create a user-defined function which takes an input string and the length of the characters which we wanted to remove from both sides of the original ... Read More

Advertisements