Results 1 to 5 of 5

Thread: split Keyword

  1. #1
    santhoshrao is offline Member
    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0

    Thumbs up split Keyword

    Hi All,
    Is it possible to use the following syntax in java

    text.split(".");

    the code does not recognises (splits) by using the Dot

    Regards
    Santhosh rao

  2. #2
    Norm's Avatar
    Norm is online now Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,401
    Rep Power
    25

    Default

    Is there an escape char you can use?
    YOU need to escape at two levels, once for the compiler and once for the regex.

  3. #3
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

    Default

    This is possible,

    Java Code:
    text.split("\\.");
    As Norm says you have to deal with regular expressions as well.

  4. #4
    jack239 is offline Member
    Join Date
    Jul 2008
    Posts
    35
    Rep Power
    0

    Default

    This applies to other symbols like ; or | if used in split() function.
    New to Java/PHP/Javascript development?
    For free help go to- www.techcubetalk.com

  5. #5
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Location
    Colombo, Sri Lanka
    Posts
    11,372
    Blog Entries
    1
    Rep Power
    20

Similar Threads

  1. How to split a String using split function
    By Java Tip in forum java.lang
    Replies: 4
    Last Post: 04-17-2009, 08:27 PM
  2. problem with split method
    By abhiN in forum New To Java
    Replies: 7
    Last Post: 02-10-2009, 01:54 PM
  3. how to split a file
    By nagaraaju in forum New To Java
    Replies: 0
    Last Post: 03-14-2008, 08:45 AM
  4. How to split a String using split function
    By JavaBean in forum Java Tip
    Replies: 0
    Last Post: 10-04-2007, 09:32 PM
  5. PDF Split and Merge 0.7 beta 1
    By JavaBean in forum Java Software
    Replies: 0
    Last Post: 06-24-2007, 08:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •