Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substring

Status
Not open for further replies.

KryptoS

Programmer
Feb 7, 2001
240
BE

Hello,

I have a string eg. String test = "test1 test2 test3" ... now I want a part of that string eg only test2. What is the code? Can someone help me?

Thanx
 
Hi winkumpen,

You have given the response in your title.
So simply use the substring method of String.

In your test :
{
...
String test2 = test.substring (6, 11);
...
}

bye --
Globos
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top