Grails Cookbook - A collection of tutorials and examples

Java String Compare

Java String is a data structure that's very essential because of it's capability to adapt in many cases. Many programmers do highly recommend utilizing this type of structure alternatively as it is easy to transform from and to other data type. For example, we can convert String to date or numerical value, vice versa. In this post, we will discuss how to compare Strings in Java

Conversion Of Java String To Integer

Assuming that we are familiar in the process of converting Java String to Double, String to Float, and String to Long. We will now be discussing the conversion of Java String To Java Integer. There are 4 ways to achieve the converted value, notice that these options we're also utilized in the previous posts related to converting Java String to a different data type - which we will be using for this post as well.

Conversion Of Java String To Double

Converting Java String To Double is one of the important topic in creating convenient systems in the world of Java. This tutorial will help you find different ways to come up with our desired value.

Converting Java Float To String Without Exponential Scientific Notation

The data type float consumes less memory when it comes to storing numbers with decimal points. Although this is the edge of it, the disadvantage is that it's not precise. In one of our posts, we discussed that the result of converting float to String is in scientific notation form. Now we show examples on how to convert float to String in Java without exponential or scientific notation.:

Converting Java String To Date

String is sometimes used in storing data such as date, numeric, alpha numeric, or other type of data. It's become a versatile data structure primarily because it's capable of handling random sequence of characters. That said, a String can be converted into another data structure.

Java String Split Dot Or Period

In some cases, we use a dot or period as delimeters in order to split a string. This topic will teach the programmers on how to split a string using a dot symbol. Observe the given examples below for a better reference.

Left Pad String With Zeros in Java

What if you want to pad String With Zeroes in it? This is also possible. A lot of programmers see the efficiency of the Left Pad String with either zeroes or spaces in it. Study and learn the examples written below on how to do this process.

Left Pad String in Java

In this post, we will discuss the Java Left Pad String. If you want to attain a specific target length, you will have to learn and understand the written example codes below in order to pad a custom character to the left side of a String.

Java Substring

One of the necessary inclusion of your tool in controlling String is the substring method. Java Substring is a valuable method in Core Java Programming. It's job is to remove or take out a sequence of characters from a String and swaps it with a new String value. By the end of this post, you will be able to understand how Java Substring works.

Left Pad String With Spaces in Java

When you work on a program or create a system that requires you to pad a String using spaces, all you need to do is to consider the width of a String. If the width is less than the target length, you can pad the String with spaces to guarantee the length of that String. Java left pad string with spaces is important specially when interfacing with older systems like a mainframe, where deciding which part of data is defined by number of characters, instead of more sophisticated way like XML or JSON format.