38 Java String-Related Techniques Making Your Life Easier

A collection of string related methods that help you achieve daily programming tasks with less time and effort.
1.8 (3 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
57 students enrolled
25% off
Take This Course
  • Lectures 43
  • Length 2 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works


Find online courses made by experts from around the world.


Take your courses with you and learn anywhere, anytime.


Learn and practice real-world skills and achieve your goals.

About This Course

Published 2/2015 English

Course Description

Working with strings is not as simple as it sounds. It can get from simple to very complex and frustrated, especially for inexperienced developers.

In this course, I want to exclusively focus on guiding different techniques that you might often encounter during daily programming tasks.

The course is a collection of more than 38 string related methods that support you in developing java applications with less painful and effort. No matter what kinds of applications you are building: desktop applications, web applications, or mobile applications, string manipulations are inevitable.

At the end of this course, you will be able to use different kinds of methods on proceeding string related requirements more easily and effectively with less overhead.

String manipulation is actually a wide topic. But after completing the course, I believe you should have solid and fundamental skills in processing strings and you can use those methods presented in the course to solve almost all common string related tasks.

What are the requirements?

  • Students who take this course should have basic levels in Java language
  • The course uses Netbeans 8 IDE running on JDK 8. These are freely downloaded
  • The course uses a third-party library: Apache Commons Lang. The library is freely downloaded

What am I going to get from this course?

  • Format a string with desired appearance
  • Format decimal numbers based on locale or with customized format
  • Format data times based on locale or with customized format
  • Manipulate strings with built-in Java APIs
  • Manipulate strings with Apache Commons Lang

Who is the target audience?

  • Developers who want to master string manipulating skills
  • Developers who want to know different and flexible ways when working with strings
  • Developers who want to apply the Apache Commons Lang to save time and effort

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.


Section 1: Formatting

You will learn different ways to format a string with custom characters as well as flags.


Different countries use different format to display numbers with decimal points and currencies. You will learn how to custom the format of those values


I will discuss more flexible ways to format decimal numbers and especially, with custom symbols.


You will learn how to display date time based on your desired locales


Besides formatting date times based locales, you will learn how to show your date times in any forms you would want

Section 2: String Manipulation With Java Built-in APIs

This lecture introduces how to break a string with substring() method and related one.


You will be introduced a more flexible way using the split() method. Some simple regular expressions will be discussed as well.


You will learn how to break a string with the Scanner class. You will also be shown using different input sources in the Scanner class.


Another sub-stringed technique is discussed: Stringtokenizer class. One of the string-related legacy classes that provides very good performance for splitting up a large string.


You will learn how to replace a sub string in a string using the 2 popular methods in the String class: replace() and replaceAll()


You will learn how to append strings to the original string using the 2 classes: StringBuffer and StringBuilder. You will also learn why we should use these 2 classes when appending a string. The differences between the 2 classes will be discussed as well.

Section 3: String Manipulation With Apache Commons Lang APIs

You will be instructed how to download the Apache Commons Lang library and add the library to your Java project.


You will learn how to shorten a string using the abbreviate() method. This is one of the most popular techniques that you should be aware of.


Capitalizing means that the first letter of a word is converted into the upper case letter. You will learn how to capitalize the first word or every word in a string.


Swapping case of a string means that upper case letters are converted to lower case letters and vice versa. In lecture will show a simple way to do that.


Sometimes, it is necessary to know the number of appearances of a sub string in a string. You will learn how to do that in this lecture.


Extracting initial letter of every word in a string is used quite often in many social networking sites so that users can have their representative abbreviation.


Working with text files sometimes leave unnecessary spaces in the source string. Normalizing spaces will remove those unused ones.


You will learn how to append a suffix to a string but only if the source string does not already end with the suffix.


You will learn how to add a prefix to the beginning of a string but only if the source does not already start with the prefix.


Very often when working with text and you need to surround strings with a certain character or sub string such as new line character, and html tags. This lecture will show you how easy it is to achieve such tasks.


One of the most common tasks when working with strings is to check the existence of a sub string or character in a source string. This lecture will show you several methods for such tasks.


2 special cases of checking for the existence of a sub string are to check if the source string starts or ends with a certain sub string.


You will learn to to easily extract sub strings from a string using 3 techniques: left, right, and middle


You will learn a special case of extracting sub strings from a string based on the types of characters.


You will learn how to add additional characters to the left or right of a string.


Sometimes, it is required to repeat a character or sub string with the number of specified times. You will learn how to do that in this lecture.


You will learn several methods that are very useful when removing a sub string in a string with practical examples.


You will learn many ways to remove spaces or specified characters in a string.


You will learn many methods for different random purposes: from creating random ASCII strings, letters, numbers only to alphabetical and numeric combination.


Very often when working with strings, you need to know the character types that the source string contains. Is it alphabetical? It is numeric? Does the input string contain only letters and digits? and so on.


If your task is to combine elements in an array into a string, then this lecture shows you how to do that. You can join elements from string array, integer array, float array, etc. You can join elements from a collection as well.


You will learn different ways to identify the index of a certain character or sub string in a string. These techniques are must-know skills when working with strings.

Section 4: Useful Constants

I will discuss the 2 constants that you can use to get the current file encoding and file separator.


Constants discussed in this lecture are used to get java related paths such as class paths, library paths, and IO temporary paths.


Constants that can be used to fetch user information such OS name, OS version, user country, language, and time zone.


Constants that are used to check the Operating System type the user is using.


Constants that can be used to check for Java platform that a user is using.

Section 5: Appendix
Source Code Project For Lectures In Section 1
Source Code Project For Lectures In Section 2
Source Code Project For Lectures In Section 3
Source Code Project For Lectures in Section 4
Section 6: Conclusion
Final words

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Sera Nguyen, Developer, Architect, Professor

Hi, my is Sera Nguyen and I have a big interest in Software Programming. After completing my Computer Science degree, I was employed as Embedded Software Engineer at Renesas Corporation, then Software Architect at CSC Corporation. After more than 6 years in the Software Industry and completing my Master degree, I became a full time University Professor specializing in Software Engineering Faculty. Currently, I am still working full time as Professor and contracting trainer for software companies and doing research for my PhD degree in software architecture design field.

Ready to start learning?
Take This Course