aspose file tools*
The moose likes Programming Diversions and the fly likes [Easy]hyphen Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Other » Programming Diversions
Bookmark "[Easy]hyphen" Watch "[Easy]hyphen" New topic
Author

[Easy]hyphen

Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
This one is quite easy.Actually subproblem from one programming competition.
Input: any String(containing combination of letters from a to z)
Output:String array,each string contains hyphen at different position
example:1) Input :a
output:-a,a-
2)Input aqw
output: -aqw,a-qw,aq-w,aqw-
Write a program.


MH
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632

[ October 07, 2004: Message edited by: Michael Dunn ]
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874
.I never thought of StringBuffer
Luis F Garcia
Greenhorn

Joined: Oct 20, 2004
Posts: 6
Hi there !!

I know I'm late, I just registered and hadn't seen this forum...

Hope you like this one:



Cheers !!
Luis F
Arjun Shastry
Ranch Hand

Joined: Mar 13, 2003
Posts: 1874

I checked all above three ways for different inputs.and checked the CPU usage and execution time.They are almost same.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: [Easy]hyphen