Geos,
I'd recommend using the Apache Velocity library http://velocity.apache.org/. It's a templating engine for strings. You're example would look like
this is a good example with 234 songs
this is $type example with $number songs
The code to do this would look like
final Map<String,Object> data = new HashMap<String,Object>();
data.put("type","a good");
data.put("number",234);
final VelocityContext ctx = new VelocityContext(data);
final StringWriter writer = new StringWriter();
engine.evaluate(ctx, writer, "Example templating", "this is $type example with $number songs");
writer.toString();