Results 1 to 4 of 4
- 03-02-2010, 08:44 AM #1
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
problem with "|" character while splitting text or string.
hi everybody,
I am having problem with "|" character while splitting text or string. but all other characters are working like (/ ; , - _).
Does "|" has a special property or does it related about its ASCII code?
my code is;
String delimeter="0";
int k = 0;
String[] list;
String line = buf.readLine();
while (line != null) {
if(k==0){
line=buf.readLine();
k++;
continue;
}
list = line.split(delimeter);
System.out.println(list[0]);
System.out.println(list[1]);
System.out.println(list[2]);
line = buf.readLine();
k++;
}
- 03-02-2010, 09:04 AM #2
just split like this
line.split("\\|");Ramya:cool:
- 03-02-2010, 09:39 AM #3
Member
- Join Date
- Mar 2010
- Posts
- 2
- Rep Power
- 0
Thanks Ramya. you solved my problem.
- 03-03-2010, 12:23 AM #4
Moderator
- Join Date
- Feb 2009
- Location
- New Zealand
- Posts
- 4,545
- Rep Power
- 11
It would be a good idea to post to the other forums saying that your problem is solved.
[Edit, next day]
Or you could just let April198474 waste their time replying at Bytes.com because you have your answer and that's all that matters. Advice here (and there) costs nothing. And neither does showing a little politeness.Last edited by pbrockway2; 03-03-2010 at 07:32 AM.
Similar Threads
-
How to change my form design from "metal" to "nimbus" in Netbeans 6.7.1?
By mlibot in forum New To JavaReplies: 1Last Post: 01-21-2010, 09:20 AM -
problem with argument list and precedence "(" and ")"
By helpisontheway in forum Advanced JavaReplies: 6Last Post: 12-24-2009, 07:50 AM -
final String currentWorld = "Java Forums"; String.format("Hello %s", currentWorld);
By mcfrog in forum IntroductionsReplies: 0Last Post: 04-02-2009, 07:02 PM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks