java - Surround string with another string -


i there utils method in java enable me surround string string? like:

surround("hello","%"); 

which return "%hello%"

i need 1 method code nicer adding prefix , suffix. don't want have custom utils class if it's not necessary.

string.format can used purpose:

string s = string.format("%%%s%%", "hello");


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -