Java မှာ String သည် စာသားသိမ်းတဲ့ object ဖြစ်ပါတယ်။ Text processing လုပ်တဲ့ app တွေမှာ String methods တွေက နေ့တိုင်းလိုအပ်ပါတယ်။ User name, email, search keyword, message, title, content—အားလုံး String ပါ။
java
public class Main {
public static void main(String[] args) {
String title = "Java Tutorial";
String email = "student@example.com";
System.out.println("Length: " + title.length());
System.out.println(title.toUpperCase());
System.out.println("Has @: " + email.contains("@"));
System.out.println("Domain starts at index: " + email.indexOf("example"));
}
}length() က character အရေအတွက်ထုတ်ပါတယ်။ toUpperCase() က စာလုံးအကြီးပြောင်းပါတယ်။ contains() က text တစ်ခုပါ/မပါ true/false စစ်ပါတယ်။ indexOf() က text စတင်တွေ့တဲ့ index ကိုပြန်ပေးပါတယ်။
You should see
Length: 13 JAVA TUTORIAL Has @: true Domain starts at index: 8လက်တွေ့အသုံးချမှု
Search box, login form, content title formatting, email checks, username cleanup တွေမှာ String methods သုံးပါတယ်။