Results 1 to 2 of 2
  1. #1
    ganeshmore is offline Member
    Join Date
    Jun 2012
    Posts
    1
    Rep Power
    0

    Default Find Special String length in jdk1.6 on Unix

    When i run this code in jdk1.6 on unix then length of string is 2994 & 2999 but actually length of both string is 3000 Pls tell me the solution


    import java.util.ArrayList;


    public class TestLength {

    /**
    * @param args
    */
    public static void main(String[] args) {
    // TODO Auto-generated method stub

    ArrayList alList = new ArrayList();
    alList.add("D0000001KRHSBC000000000006 KRHSBC002083095 KR KR KRWSVR 1 0203 NN 5 AAAAAAA AAAAA AAAAAAA AAAAA AAAAAAAAAAAAA ÝAÊ/E~E~Ð~Ü/¡(ß*¡) AAAAAAAAAAAAA ÝAÊ/E~E~Ð~Ü/¡(ß*¡) AAAAAAAAAAAAAAAAAAA ATTN:à7ßµãviAàÁlÙ AAAAAAAAAAAAAAAAAAAAAAA ÔŸÞi×~ hÁÊ»Äa jvJµnß ¡9¡0 AAAAA AAAAA maÞÁxzpß¡5CÁ 135-010 135-010 135-010 100 KIM DONG BIN H3000000000000000.000+ ");
    alList.add("D0000001KRHSBC000000000008 KRHSBC002085900 KR KR USDSVR 1 0200 NN 5 AAAA AAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA AAAA AAAAAAAAAAA AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAA ÔŸÞi×~ âpÄa HaëÁÎ~2h/310 AAAAAAAAAAAAAAAAAAAAAAAA HaëÁÎ~xzpß25CÁ AAAAA 100-767 100-767 100-767 100-767 13 KIM SUNG WOOK H ");
    //java.net.URLDecoder.decode(alList[0],"UTF-8");
    //System.out.println(alList.size());
    System.out.println(((String) alList.get(0)).length());
    //System.out.println(((String) alList.get(1)).length());
    }

    }

  2. #2
    Tolls is online now Moderator
    Join Date
    Apr 2009
    Posts
    10,480
    Rep Power
    16

    Default Re: Find Special String length in jdk1.6 on Unix

    No it's not.
    The first one is 394 characters long.
    Neither of those are 3000 characters long.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Replies: 3
    Last Post: 01-12-2012, 10:33 AM
  2. Replies: 11
    Last Post: 08-15-2011, 10:12 AM
  3. Replies: 2
    Last Post: 02-09-2011, 04:12 PM
  4. Replies: 2
    Last Post: 10-22-2010, 07:54 PM
  5. JNLP - Swing application compiled in jdk1.5 not working in jdk1.6
    By mahendra.athneria in forum AWT / Swing
    Replies: 4
    Last Post: 01-20-2009, 08:27 PM

Posting Permissions

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