Java String

Java String

By: Stephen Patrick | 25 May 2016 | Category: Java String

Java String

A Java String is a sequence of characters. A Java String can be considered an Array of characters where each index in the array is a character. A Java String can be defined using literal syntax by enclosing a sequence of characters between a pair of double quotes

Read More

Java String Performance

By: Stephen Patrick | 25 May 2016 | Category: Java String

Java String Performance

A Java String as discussed in a previous section provides a data structure to treat a sequence of characters as a String. Java Strings have a number of performance issues that you as a Java Developer should be aware of.

Read More

Java String: Find The Length Of A String

By: Stephen Patrick | 26 May 2016 | Category: Java String

Java String: Find The Length Of A String

Java String are immutable objects as previously discussed. Lets see how we can find the length of a Java String. The Java String class contains the length method. We can use this method to find the length of a Java String.

Read More

Java String: String Has Length

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Length

Let's look at another example to determine if a java string has a length. The Java String class contains the length method. We can use this method to check the length of a java string.

Read More

Java String: String Has Text

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Text

Let's look at another example to determine if a java string has a given sequence of characters that is any character other than a whitespace character. The Java String class in java is a class which encapsulates a sequence of characters. A Java String is an object and has various methods which we can call.

Read More

Java String: String Has Whitespace

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: String Has Whitespace

Let's look at another example to determine if a java string has any character that is a whitespace character. The Java String class in java can contain any sequence of characters. Lets create an example to determine if a java string has a whitespace character.

Read More

Java String: Trim String

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: Trim String

The java string class comes packaged with a trim method. The java string trim method removes the leading and trailing whitespace from a String. Let's write some code to implement the java string trim method.

Read More

Java String: Trim All Whitespace From String

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: Trim All Whitespace From String

The java string class comes packaged with a trim method. The java string trim method removes the leading and trailing whitespace from a String. Let's write some code to implement a variation of the java string trim method. This method will take a java string but instead of removing the leading and trailing whitespace from a java string, we will remove all of the white space from a java string.

Read More

Java String: Trim Leading Whitespace From String

By: Stephen Patrick | 27 May 2016 | Category: Java String

Java String: Trim Leading Whitespace From String

The java string class comes packaged with a trim method. The java string trim method removes the leading and trailing whitespace from a java String. The trim method of the java string class can be useful to normalize a string before we perform comparison operations or displaying it on some medium. Below we will write some code to implement a trim method to remove all leading whitespace from a java string.

Read More