Problem:
The web is built with HTML strings like "Yay" which draws Yay as italic text. In this example, the "i" tag makes and which surround the word "Yay". Given tag and word strings, create the HTML string with tags around the word, e.g. "Yay".
makeTags("i", "Yay") → "Yay"
makeTags("i", "Hello") → "Hello"
makeTags("cite", "Yay") → "Yay"
Solution:
public String makeTags(String tag, String word) { return "<"+tag+">"+word+"</"+tag+">"; }
public String makeTags(String tag, String word) {
ReplyDeletereturn ("<" + tag + ">" + word + "");
}