aspose file tools*
The moose likes Beginning Java and the fly likes need help Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "need help" Watch "need help" New topic
Author

need help

mandy fern
Greenhorn

Joined: Aug 21, 2001
Posts: 12
How do I write a program to extract initials from a name which has the following format:[ Dr. ] First name second first name third first name... Surname. The output should be something like this R. W. D. F.!
James Gray
Ranch Hand

Joined: Sep 10, 2001
Posts: 30
How about using a java.util.StringTokenizer to break the name into seperate tokens, ignoring title tokens like the "Dr." in your example, and otherwise storing/printing the first character of each token?
mandy fern
Greenhorn

Joined: Aug 21, 2001
Posts: 12
How do I print first character of each token?
Thanks
William Barnes
Ranch Hand

Joined: Mar 16, 2001
Posts: 985

The "nextToken" method returns a String. So you will be printing the first character of a String (which I think you already know how to do).


Please ignore post, I have no idea what I am talking about.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: need help