hoe to capture certain part of the line in file ?
now i have a file that contents below this:
for my problems is i just want to capture the file start from cd .....
until the second "/",which means for first and second line is start from
cd.... until "J973dbs"(whitout the "/") .
and for third line is from cd .... until "XC56311_RevA_R1_5C_H"
(without the "/" ).
i try to use String command like this :
int i = line.indexOf("cd");
int j = line.lastIndexOf("/");
line = line.substring(i,j);
but i notice the result show only "cd /" and i think it is not flexible
cause what i want is always detect from the first character until the last
so do you have any command that i can use ?
by the way ,if slove for the first question,how can i detect the last
string after the last "/" ?
thanks a lot.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL