File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes substring problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "substring problem" Watch "substring problem" New topic

substring problem

preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518

From the following output:

Channel Location State Application(Data)
SIP/NBE-09749568 (None) Down (None)
1 active channel
0 active calls

I need to take SIP/NBE-09749568.How can i split this.I tried using substring,but i am unable to get what i need.please assist me to do this.

Ranjana Patil

Joined: Nov 17, 2006
Posts: 1
try with str.substring(40,56) it should work fine. Does the source String includes new lines?
preethi Ayyappan
Ranch Hand

Joined: Oct 04, 2007
Posts: 518
Thanks.It is working fine by using

String channel2=channel.substring(0,16);

I agree. Here's the link:
subject: substring problem
Similar Threads
taking a particular data from a number of lines
Socket program for linux
how to check the channel count
substring problem
how to split the particular datas from group of datas