SyntaxFix
Write A Post
Hire A Developer
Questions
The first case is done using the insert() method:
insert()
_sb.insert(0, "Hello ");
The latter case can be done using the overloaded + operator on Strings. This uses a StringBuilder behind the scenes:
String s2 = "Hello " + _s;