Tech Study

Write a Swift program that accept two strings and return their concatenation, except the first char of each string

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 concatestr(_ str1: String, _ str2: String) -> String {
    var part1 = str1.characters
    var part2 = str2.characters
    part1.removeFirst()
    part2.removeFirst()
 
    return String(part1)+String(part2)
}
print(concatestr("ttech", "study"))
print(concatestr("pprogram", "ming"))

Result

Write a Swift program that accept two strings and return their concatenation, except the first char of each string
Write a Swift program that accept two strings and return their concatenation, except the first char of each string

Taggedexcept the first char of each stringWrite a Swift program that accept two strings and return their concatenation

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