Results 1 to 2 of 2
  1. #1
    crazy is offline Member
    Join Date
    Jul 2013
    Posts
    6
    Rep Power
    0

    Default Storing value of String in an array!!!!!!!!!!!!

    class Temp
    {
    static void allTrim(String s)
    {
    for(int i=0;i<s.length();i++)
    {
    String l;
    char c=s.charAt(i);
    if(c!=' ')
    {
    //I want to store the value in an array which comes in this 'if' loop.
    System.out.println(c);
    }
    }
    }
    public static void main(String... aaa)
    {
    String s=" I have a need a need for speed ";
    System.out.println(s);
    allTrim(s);
    }
    }


    I want to store the value in an array which comes in the 'if' loop above. How to do it?????????????

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,453
    Rep Power
    20

    Default Re: Storing value of String in an array!!!!!!!!!!!!

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Similar Threads

  1. Replies: 10
    Last Post: 02-24-2013, 08:18 PM
  2. Storing array?
    By LifeElixer in forum New To Java
    Replies: 7
    Last Post: 04-14-2011, 07:10 AM
  3. Storing a string in StringTokenizer
    By kgkamaraj in forum New To Java
    Replies: 3
    Last Post: 02-12-2010, 02:58 PM
  4. Storing in an Array
    By Bascotie in forum New To Java
    Replies: 10
    Last Post: 10-15-2009, 06:12 AM
  5. storing a string in an array
    By tiyani in forum New To Java
    Replies: 3
    Last Post: 08-12-2009, 08:25 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
  •