split

Discussion in 'Java' started by shadykazan@gmail.com, Feb 9, 2007.

  1. Guest

    hi im trying to split a string into an array using string.split
    my delimiter is the null character '\u0000'
    the problem is that when there are 2 or more consecutive null
    characters,
    they don't get split.
    i have tried
    data.replaceAll("\u0000{2}","\u0000 \u0000");
    String [] array=data.split("\u0000");

    but it did not work
    im not so good at regular expressions
     
    , Feb 9, 2007
    #1
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ajit

    split a tab delimited string

    Ajit, Jul 28, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    20,355
  2. Michael
    Replies:
    3
    Views:
    583
    Jonathan Bromley
    Jul 22, 2004
  3. mkokelma

    split matrices

    mkokelma, Oct 21, 2004, in forum: VHDL
    Replies:
    5
    Views:
    1,037
    mkokelma
    Oct 22, 2004
  4. Replies:
    2
    Views:
    654
  5. Carlos Ribeiro
    Replies:
    11
    Views:
    967
    Alex Martelli
    Sep 17, 2004
  6. trans.  (T. Onoma)

    split on '' (and another for split -1)

    trans. (T. Onoma), Dec 27, 2004, in forum: Ruby
    Replies:
    10
    Views:
    459
    Florian Gross
    Dec 28, 2004
  7. Sam Kong
    Replies:
    5
    Views:
    547
    Rick DeNatale
    Aug 12, 2006
  8. Stanley Xu
    Replies:
    2
    Views:
    1,056
    Stanley Xu
    Mar 23, 2011
Loading...