String Split in Java


public class StringSplit {

public static void main(String[] args) {
String name = "Faisal,Porag";

String[] lists = name.split(",");

String firstName = lists[0];
String lastName = lists[1];

System.out.println("First name is : " +firstName);
System.out.println("Last name is : "+lastName);
}
}


মন্তব্যসমূহ

Popular Posts

একজন অভিজ্ঞ প্রোগ্রামারের পরামর্শ

Write a program which can print the following sequences: Sample Output: 1, 10, 100, 1000, ……, N 1, 3, 6, 10, 15, ……, N

Simple 2D hut design in computer graphics using c++