Thuta Learning
BasicProgrammingbeginner

Strings

Relax. We'll talk through this in plain words — no textbook voice.

String is used to store things like usernames, messages, titles, descriptions, and API response text. Swift strings come with useful methods like interpolation, prefix/suffix checks, uppercase/lowercase, and count.

swift
let productName = "Thuta Studio"
let featureCount = 12

let message = "\(productName) includes \(featureCount)+ creative tools."

print(message)
print(message.hasPrefix("Thuta"))
print(productName.uppercased())

\(productName) and \(featureCount) drop variable values right into the sentence. hasPrefix() checks whether a string starts with the given text.

You should see
Thuta Studio includes 12+ creative tools. true THUTA STUDIO

Easy traps

  • If you need a quote character inside a string, you can escape it. For example: "Hello".