Results 1 to 3 of 3
  1. #1
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

    Default Split string and remove

    Hi,

    How am i supposed to only read

    banana : banano, banane

    only the first word banana only and remove the second string (banano and banane). Thanks.

  2. #2
    nap_patague is offline Member
    Join Date
    Mar 2011
    Location
    Bulacan, Philippines
    Posts
    23
    Rep Power
    0

    Default

    Java Code:
    String sample="banana : banano, banane"
    String data[]=sample.split(" : ");
    String out=data[0].trim();
    Keep Moving Forward

  3. #3
    drogba123 is offline Member
    Join Date
    Mar 2011
    Posts
    29
    Rep Power
    0

Similar Threads

  1. String split help
    By YoungJavaBoy in forum New To Java
    Replies: 7
    Last Post: 01-19-2011, 02:39 AM
  2. Split a String with split()--Help
    By danilson in forum New To Java
    Replies: 7
    Last Post: 11-19-2010, 05:08 PM
  3. String split
    By soccer_kid_6 in forum New To Java
    Replies: 3
    Last Post: 10-29-2010, 08:51 PM
  4. How to split a String using split function
    By Java Tip in forum java.lang
    Replies: 4
    Last Post: 04-17-2009, 09:27 PM
  5. How to split a String using split function
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 10:32 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
  •