Grails Cookbook - A collection of tutorials and examples

Groovy String drop()

Groovy is one of the most fun language I ever tried to use. Maybe Ruby is equally fun but I have never tried it. Because I came from the Java line of programming, Groovy is more natural to me because it is the superset of Java and I get the chance to use any third party Java library inside Groovy. How fun is that? In this post we discuss another convenience method from String class. We will show how to use Groovy String drop method.

Groovy String reverse()

Java developers will just love using Groovy. it is a natural transition because every library that can be used in Java can be used in Groovy, plus we get to use a wonderful programming language that is very convenient to use. For example, the String class reverse method. It reverses a String with no external library necessary to use, nor we need to code anything special. We explore in this post how to use Groovy String reverse method.

Groovy String take()

The Groovy language provides many convenience method to do cool stuff, specially on String manipulation. In this post, we will check a special way to have a substring of a string using the Take method. We will explore some samples on how to use Groovy String Take method.

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.

Grails Select Enum Values

It is more convenient that we use Enums in our domain classes rather than String, when we are really sure that Enum is the best representation of a property. Maintaining Strings and constants is just a pain. But it is common problem on how to create a form that accepts Enum values. Below is an example on how to use Select Tag inGrails to choose from Enum values.