Results 1 to 3 of 3
  1. #1
    hla40 is offline Member
    Join Date
    May 2011
    Posts
    3
    Rep Power
    0

    Post Need help creating a String/Array?

    I am trying to test some code at home since I don't have access to the full system. I need to be able to retrieve user information that contains something along the lines of name, title, company. For example, I would need: userInformation = (n=Doe.John.1234567890 , t=Accounting , c=CorpCompany). [At work this information is generally pulled as one automatically using a cert, so that's my dilemma in trying to make an "at home" version to test]

    I need to somehow put that information into a string/array because the code following it would pull the information, split it, and parse certain information out of it.

    Here's the code that would follow it:
    String[] userValues = userInformation.split(",");
    String[ userItem = userValues[userValues.length-1].split("=")
    String[] userNumber = userItem[1].split("\\.");
    String usernames = userNumber[userNumber.length-1];
    String username = usernames + "@CorpCompany";


    That being said, How can I go about making all that information available in one area so that it can be split and parsed properly?

    Thanks in advance!

  2. #2
    Junky's Avatar
    Junky is offline Grand Poobah
    Join Date
    Jan 2011
    Location
    Dystopia
    Posts
    3,798
    Rep Power
    7

    Default

    Why not have a custom class that holds all your information. As you read a line of data and extract(split) it, create a new Object with this data and then store the Object in an array or List.

  3. #3
    hla40 is offline Member
    Join Date
    May 2011
    Posts
    3
    Rep Power
    0

Similar Threads

  1. help with creating string
    By peter123 in forum New To Java
    Replies: 1
    Last Post: 05-05-2011, 12:41 PM
  2. create a 2d char array from a 1D string array
    By jschmall12 in forum New To Java
    Replies: 1
    Last Post: 04-27-2010, 09:01 PM
  3. Convert Char Array to String Array
    By Mayur in forum New To Java
    Replies: 8
    Last Post: 10-12-2009, 11:41 AM
  4. Creating Array of Characters From a String
    By ngc0202 in forum New To Java
    Replies: 6
    Last Post: 07-30-2009, 07:30 AM
  5. Replies: 1
    Last Post: 08-03-2007, 10:52 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
  •