Java for Humans {String Manipulation}

Lincoln W Daniel
ModernNerd Code
Published in
9 min readJan 17, 2016

--

View Table of Contents | Download Supporting Code | Subscribe to ModernNerd Youtube Channel for Coding Videos | By Lincoln W Daniel

Java Strings are powerful. While a String seems simple as a mere representation of character strings, they are one of the best ways to store information, data in Java. Because character strings are so vital to programming, the creators of Java decided to dedicate an entire class to them and give that class useful methods to make data manipulation easier. In this chapter, we will learn how to use some of the instance methods of the String class to compare strings, search a string for individual characters or substrings, extract substrings, and more. It is not necessary that you read this whole chapter, but it is important that you know these functions are available to you.

Why String Manipulation is Important & Useful

Often times in your programs, you will be presented with data which you can store as a String. When you have the data stored as a String instance, you can use the instance methods of the String class to manipulate the data. This functionality allows you to do more things with the data you have.

Comparing Strings

A operation you will run many times in your programs is a operation to compare two String instances to one another. If you have a Facebook account, you will be asked for your username and password when you try to log in. Behind the scenes…

--

--

Lincoln W Daniel
ModernNerd Code

Chief Bull @ BullAcademy.org ® Elevating writers @ ManyStories.com. Author @JavaForHumans Ex: Editor in Chief MarkGrowth (acq.), Engineer @Medium @GoPuff