Life always has a way of doing whatever it needs to do. There’s nothing wrong with that thought process. It comes and goes without a second thought. We can’t easily figure out why life does this to us, we have to understand something at some point, but if we don’t? Well, no harm no foul. It’s life and we have to continue going forward to see everything that is out there. There’s nothing we can do about it. Life will move foreward without the ability for us to do anything but wonder what this life will eventually be like in the far distant future. Oh what a joy that could bring about. If life has a way, we will be able to get from point a to point b in no time at all. It feels like a circle at times. A = B = C, isn’t that what the crazy future guy in Star Trek: Voyager tried to explain? Yeah, something like that. It’s quite an interesting thought process to be sure. It’s life though, nothing can be done about it. So let life be what it wants to be, there’s nothing wrong with that tho...
A simple way to create html tags in Java.
It won't create a tree that you can parse, but it will create the text needed. You see we'll use the StringBuilder class along with the Formatter class to accomplish this. This provides a simple way to format a string without using String.format inside of a sb.append call.
import java.util.Formatter;
import java.util.Locale;
public class LocalMe {
public static void main(String[] args) {
StringBuilder sb = new StringBuilder();
Formatter formatter = new Formatter(sb, Locale.ENGLISH);
formatter.format("<%s>%s</%s>", "greeting", "Hello World", "greeting");
System.out.println(formatter.toString());
}
}
Comments
Post a Comment