Results 1 to 4 of 4
Like Tree1Likes
  • 1 Post By JosAH

Thread: How to read a particular parf of an sentences ???

  1. #1
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Question How to read a particular parf of an sentences ???

    I wanna get user student's faculty from AD. But it has stored in a domain like this :

    Universityname/student/faculty/...

    How to i get just third part(the faculty name) and write it in a jtextfield ???
    Best regards...

  2. #2
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,508
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by qwerty53 View Post
    I wanna get user student's faculty from AD. But it has stored in a domain like this :

    Universityname/student/faculty/...

    How to i get just third part(the faculty name) and write it in a jtextfield ???
    Best regards...
    You have to be able to distinguish the first part from the second part and distinguish the second part from the third part. Is there any distinguishing character or characters? If so, have a look at the String.split( ... ) method.

    kind regards,

    Jos
    qwerty53 likes this.
    cenosillicaphobia: the fear for an empty beer glass

  3. #3
    qwerty53's Avatar
    qwerty53 is offline Member
    Join Date
    Jul 2011
    Posts
    32
    Rep Power
    0

    Default

    what about stringtokenizer ? which one is useful ?

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    Always prefer split over string tokenizer. String tokenizer is only still around for legacy code.

    From the API: StringTokenizer is a legacy class that is retained for compatibility reasons although its use is discouraged in new code. It is recommended that anyone seeking this functionality use the split method of String or the java.util.regex package instead

Similar Threads

  1. Randomly Generate Sentences
    By kevorski in forum New To Java
    Replies: 18
    Last Post: 10-27-2010, 04:40 AM
  2. Replies: 1
    Last Post: 02-28-2010, 03:06 PM
  3. Replies: 8
    Last Post: 09-15-2009, 11:53 AM
  4. Creating random sentences
    By bluekswing in forum New To Java
    Replies: 4
    Last Post: 06-27-2007, 05:45 PM
  5. vars and if sentences in XSL-FO
    By Alan in forum XML
    Replies: 1
    Last Post: 05-31-2007, 02:24 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
  •