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 Java Interview Guide this week in the Jobs Discussion 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
It's not a secret anymore!