Concept
How can StringBuilder be used to format a name?
ComputerScienceOne / Arrays of Strings
"String firstName = \"Tom\";\n\nString lastName = \"Waits\";\n\nString formattedName = new StringBuilder(lastName)\n\n.append(\", \")\n\n.append(firstName)\n\n.toString();\n\nYou can also use the StringBuilder class yourself directly."
Related Ideas
- How does string concatenation work in Java?ComputerScienceOne · String Methods
- How does Java make working with strings easier?ComputerScienceOne · Basics
- How are String variables declared and reassigned in Java?ComputerScienceOne · Basics
- How do you concatenate strings in PHP?ComputerScienceOne · String Functions
- How can you convert a Student structure into a string?ComputerScienceOne · To String Functions
- How can strings be created and assigned to variables?ComputerScienceOne · Basic Operations
- How do you find the length of a string and iterate over its characters?ComputerScienceOne · String Methods
- How do you access individual characters with the String charAt() method?ComputerScienceOne · String Methods