Android Build an Interactive Story App Finishing the User Interface Formatting Strings

String.format(), Why do we use it?

This question refers to the video titled-'Formatting Strings'

1 Answer

alastair cooper
alastair cooper
25,419 Points

It means that we can add the users name into the story. This would be impossible without some way of formatting(changing) the text for each individual user. The format function looks for a particular set of characters and if it finds them it changes them to the name the user entered at the start.