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
Post a Comment