aspose file tools
The moose likes Java in General and the fly likes split function of string Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "split function of string" Watch "split function of string" New topic
Author

split function of string

Manojit Babu
Greenhorn

Joined: Oct 24, 2007
Posts: 3
Can any body make me unnderstand what this means
split("\\s*,\\s*");

Thanks in advance
[ October 24, 2007: Message edited by: Bear Bibeault ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Not an advanced question. Moving...

You may benefit from reading this.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Remko Strating
Ranch Hand

Joined: Dec 28, 2006
Posts: 893
The following link may help you

java.util.regex.Pattern


Remko (My website)
SCJP 1.5, SCWCD 1.4, SCDJWS 1.4, SCBCD 1.5, ITIL(Manager), Prince2(Practitioner), Reading/ gaining experience for SCEA,
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 16813
    
  19

Originally posted by Manojit Babu:
Can any body make me unnderstand what this means
split("\\s*,\\s*");

Thanks in advance


The split command uses a regex to specify the delimiter, which is used to split a string. In this case, the delimiter is zero or more white spaces, followed by a comma, followed by zero of more white spaces. Another way to think of it is -- the delimiter is really just a comma, and the split command will also trim off the white spaces near them as well.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: split function of string
 
Similar Threads
Display Check Boxes & Dropdowns in Struts with search results
NumberFormatException
Help Required in using StringTokenizer
how do i split this?
tokenizer help