Results 1 to 4 of 4
  1. #1
    fmuddy is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Exclamation 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++;

    }

  2. #2
    RamyaSivakanth's Avatar
    RamyaSivakanth is offline Senior Member
    Join Date
    Apr 2009
    Location
    Chennai
    Posts
    826
    Rep Power
    6

    Default

    just split like this
    line.split("\\|");
    Ramya:cool:

  3. #3
    fmuddy is offline Member
    Join Date
    Mar 2010
    Posts
    2
    Rep Power
    0

    Default

    Thanks Ramya. you solved my problem.

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,565
    Rep Power
    12

    Default

    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

  1. Replies: 1
    Last Post: 01-21-2010, 09:20 AM
  2. problem with argument list and precedence "(" and ")"
    By helpisontheway in forum Advanced Java
    Replies: 6
    Last Post: 12-24-2009, 07:50 AM
  3. Replies: 0
    Last Post: 04-02-2009, 07:02 PM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •