Thuta Learning
ရှာဖွေရန်
BasicProgrammingbeginner

Strings

စိတ်လျှော့ပါ။ ဒီခန်းကို စာအုပ်လိုမဟုတ်ဘဲ စကားပြောသလိုပဲ၊ နားလည်လွယ်အောင် ရှင်းပါမယ်။

String က user name, message, title, description, API response text စတာတွေသိမ်းဖို့သုံးပါတယ်။ Swift string မှာ interpolation, prefix/suffix check, uppercase/lowercase, count စတဲ့ useful methods တွေရှိပါတယ်။

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) နဲ့ \(featureCount) က variable value တွေကို sentence ထဲသွင်းထားတာပါ။ hasPrefix() က string ရဲ့အစမှာ သတ်မှတ်ထားတဲ့ text ပါ/မပါ စစ်ပါတယ်။

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

ဒီနေရာမှာ လူအများမှားတတ်တယ်

  • String ထဲမှာ quote ပါချင်ရင် escape လုပ်ရနိုင်ပါတယ်။ ဥပမာ "Hello" ။
Strings | Thuta Learning