Java tutorial
//package com.java2s; import java.util.StringTokenizer; public class Main { public static String tag(String inString) { return "<" + inString + ">"; } public static String tag(String inElement, String inString) { StringTokenizer wkTok = new StringTokenizer(inElement, " "); String wkElementOnly = inElement; wkElementOnly = wkTok.nextToken(); return tag(inElement) + inString + etag(wkElementOnly); } public static String etag(String inString) { return "</" + inString + ">"; } }