
hello sir....i have one table in which i have 3 columns First Name,Middle Name,Last Name...............but i have to show single name in datagrid view in jsp page using concat string tokenizer......for example- First Name-Ranvir Middle Name-Kumar Last Name-Kapoor i have to print Ranvir Kumar Kapoor...... how can i do it....plz help me.......its very urgent????????

Here is an example of StringTokenizer class that accept the full name from the user and display the first name, middle name and last name.
import java.util.*;
public class GetMiddleName
{
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.println("Enter your full name: ");
String fullName = input.nextLine();
StringTokenizer stok = new StringTokenizer(fullName);
String firstName = stok.nextToken();
StringBuilder middleName = new StringBuilder();
String lastName = stok.nextToken();
while (stok.hasMoreTokens())
{
middleName.append(lastName + " ");
lastName = stok.nextToken();
}
System.out.println("First Name: "+firstName);
System.out.println("Middle Name: "+middleName.toString().trim());
System.out.println("Last Name: "+lastName);
}
}
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.