Welcome to Dream.In.Code
Become a Java Expert!

Join 149,617 Java Programmers for FREE! Get instant access to thousands of Java experts, tutorials, code snippets, and more! There are 1,867 people online right now. Registration is fast and FREE... Join Now!




Extracting a substring

 
Reply to this topicStart new topic

Extracting a substring

fransmyth
21 Aug, 2007 - 11:19 AM
Post #1

New D.I.C Head
*

Joined: 21 Aug, 2007
Posts: 1


My Contributions
Hi, i need to write a line of java program code which would extract the substring "John" from the String data value represnting the full name of a person: Peter John Smith and assign it to a separate String variable. Please some one help me!
User is offlineProfile CardPM
+Quote Post

William_Wilson
RE: Extracting A Substring
21 Aug, 2007 - 12:44 PM
Post #2

lost in compilation
Group Icon

Joined: 23 Dec, 2005
Posts: 4,101



Thanked: 25 times
Dream Kudos: 3275
Expert In: Java, C, Javascript

My Contributions
i don't see how to help you without giving you the answer, in a static case like this, lookup the method substring under String, otherwise you may want to learn about arrays and the split method.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 1/8/09 12:37AM

Be Social

Dream.In.Code RSS Feed Dream.In.Code LinkedIn Group Follow Us On Twitter

Live Java Help!

Java Tutorials

Reference Sheets

Java Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month