Swift Program to Create a String With Repeated Values

You are currently viewing Swift Program to Create a String With Repeated Values

Swift program to create a string with repeated values

// Swift program to create a string
// with repeated values

let str = String(repeating:"AB", count:4)

print(str)

output

ABABABAB

...Program finished with exit code 0
Press ENTER to exit console.

Ranjith

Hi, I'm Manoj a full-time Blogger, YouTuber, Affiliate Marketer, & founder of Coding Diksha. Here, I post about programming to help developers.

Leave a Reply