In this example we will demonstrate how to pad the end of a string with spaces. We choose a random string of warhawks calling padRight passing in length of the final string and the value to place at the end. We will check if the padded string has the length of ten. A similar example showing how to pad a string with trailing spaces in java guava or apache commons.