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

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -