Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 6 of 6

Thread: Multi Dimensional Array help NEEDED URGENT

  1. #1
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Multi Dimensional Array help NEEDED URGENT

    i want to write a function which accepts the stream which looks some wat like this....

    PERMISSIONS:TRUE,TRUE|ENTITIES PERMITTED,AB,ABCD,EF,EFGH,IJ,IJKL|FETCHING DETAILS,201.100.3.2,301,201.100.3.3,309|


    and i want to make a 2 dimensional array which holds the splitted feilds.....

    structure of function needed is is as follows....


    public String spliter(String stream,String eot/*|*/,String coma/*,*/,String feild)
    {
    }



    any bright mind pls help me its urgent..............


  2. #2
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Multi Dimensional Array help NEEDED URGENT

    Hello, if you first split the string using String.split and passing in the pipe | that should get you all the main sections and then parse each section using either colon or comma to get the rest out.

    Does that make any sense?

    // Json

  3. #3
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Multi Dimensional Array help NEEDED URGENT

    Buddy m wring this method for a j2me application which does not have split()!!!!

  4. #4
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Multi Dimensional Array help NEEDED URGENT

    maybe you can use this, i found this in another forum discussing the same topic:

    #     public static Vector split(String s, char c)  
    #     {  
    #         Vector parts = new Vector();  
    #         if ( s != null )  
    #         {    
    #             int lastfound = 0;  
    #             int pos = 0;  
    #             while ( (lastfound = s.indexOf(c,pos)) != - 1 )  
    #             {  
    #                 parts.addElement(s.substring(pos,lastfound));  
    #                 pos = lastfound+1;  
    #             }  
    #             if ( pos <  s.length() ) parts.addElement(s.substring(pos));  
    #         }  
    #           
    #         return parts;  
    #     }

  5. #5
    Super Moderator Json's Avatar
    Join Date
    Jul 2009
    Location
    Warrington, United Kingdom
    Posts
    1,274
    My Mood
    Happy
    Thanks
    70
    Thanked 156 Times in 152 Posts

    Default Re: Multi Dimensional Array help NEEDED URGENT

    Surely you have the String class in J2ME, no?

    // Json

  6. #6
    Junior Member
    Join Date
    Feb 2010
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Multi Dimensional Array help NEEDED URGENT

    thnx for the help ppl but i got the solutuion to this problem i've got the code!!!

Similar Threads

  1. array program assistance needed
    By JavaNoob82 in forum Collections and Generics
    Replies: 4
    Last Post: December 14th, 2009, 05:49 AM
  2. Array program help needed
    By SCM in forum Loops & Control Statements
    Replies: 2
    Last Post: December 2nd, 2009, 11:28 PM
  3. Urgent Help needed with java codes
    By makarov in forum Java Theory & Questions
    Replies: 0
    Last Post: November 13th, 2009, 07:23 AM
  4. Urgent code needed
    By subhvi in forum AWT / Java Swing
    Replies: 4
    Last Post: August 27th, 2009, 12:55 AM
  5. How to show 2D array using combobox and radiobutton?
    By Broken in forum Loops & Control Statements
    Replies: 1
    Last Post: March 10th, 2009, 06:01 AM