I didn't get your question well. But these approaches may help.
You can try string replace like this:
String a = "Today is my 'birthday' and i am celebrating with my 'friends'. friends is 'the' best part of life";
a = a.replace("'birthday'", "'first day'");
a = a.replace("'friends'", "'family'");
a = a.replace("'the'", "'one of the'");
System.out.println(a);
Output:
Today is my 'first day' and i am celebrating with my 'family'. friends is 'one of the' best part of life
Or if you can parameterize the message strings then do it like this.
String b = "Today is my {0} and i am celebrating with my {1}. friends is {2} best part of life";
String[] arguments = {"first day", "family", "one fo the"};
b = MessageFormat.format(b, arguments);
System.out.println(b);
For more information refer MessageFormat class.
There is already a huge discussion here How to format strings in Java