Tech Study

Write a Swift program to draw a HTML string as bold or italic text

Introduction

I have used Swift for windows 1.9 for debugging purpose. But you can use any Swift programming language compiler as per your availability.

func html_tags(_ tag: String, _ text: String) -> String {
    let opening_tag = "<\(tag)>"
    let closing_tag = ""
    return "\(opening_tag)\(text)\(closing_tag)"
}
print(html_tags("i", "HTML"))
print(html_tags("b", "Swift"))

Result

Write a Swift program to draw a HTML string as bold or italic text
Write a Swift program to draw a HTML string as bold or italic text

TaggedWrite a Swift program to draw a HTML string as bold or italic text

Java Final keyword

Introduction : java final keyword The final keyword present in Java programming language is generally used for restricting the user. …

Read more

C++ Memory Management: new and delete

C++ Memory Management We know that arrays store contiguous and the same type of memory blocks, so memory is allocated …

Read more