This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Split String by $ Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Split String by $" Watch "Split String by $" New topic
Author

Split String by $

Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Hi,
I am trying to split a string by $ ..but I am not getting desirable output.
here is my code..


output:
Hello
strArr:0 element ->Fri Jul 16 16:01:23 IST 2010 $ sds
Run successfully..


Please help me out on this.
Thanks..
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
one small correction ..

String strArr[]=str.trim().split("$");
instread of this // String strArr[]=str.trim().split("//$");


please help me.
Martin Vanyavchich
Ranch Hand

Joined: Sep 16, 2008
Posts: 241
Wrong slashes try


SCJP 6, OCMJD 6, OCPJWSD 6
I no good English.
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 632

Try this one
>


Life is easy because we write the source code.....
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Thanks a lot Pramod and Martin for your quick reply...
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Split String by $
 
It's not a secret anymore!