Results 1 to 4 of 4
Thread: Repeat a letter twice in java.
- 03-23-2010, 03:41 AM #1
Member
- Join Date
- Feb 2010
- Posts
- 7
- Rep Power
- 0
Repeat a letter twice in java.
Hi In need to write a program that repeats a letter twice.
For example the word the car. I would like the program to repeat with word a. ----------------So the output comes out to be caar.-----------------------
Does anyone know what method I can use?
All I have so far is:
public class Words
{
/**
Computes a string that repeats every letter 'a' in the original string.
@param s any string
@return a string with the same characters as s, except that every letter 'a' is repeated
*/
public String stutter(String s)
{
}
}
- 03-23-2010, 07:33 AM #2
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
What have you tried?
Read the API specs for String class to see the available methods and pick the one that you think best solves the problem.
- 03-23-2010, 08:03 AM #3
- 03-23-2010, 09:56 AM #4
Senior Member
- Join Date
- Aug 2009
- Posts
- 2,388
- Rep Power
- 6
Similar Threads
-
Help with a repeat
By leeavital in forum New To JavaReplies: 1Last Post: 01-01-2010, 09:42 PM -
Go-back-N & Selective repeat protocol
By Engineera in forum NetworkingReplies: 3Last Post: 01-14-2009, 11:18 PM -
Repeat while answer yes - do while loop
By AJ2009 in forum New To JavaReplies: 1Last Post: 01-10-2009, 06:19 PM -
java.util.zip.ZipException: invalid bit length repeat EXCEPTION
By hemanthjava in forum Advanced JavaReplies: 1Last Post: 07-02-2008, 02:15 PM -
nested <ui:repeat> - problem
By hackerofcrackers in forum JavaServer Faces (JSF)Replies: 0Last Post: 06-20-2008, 10:06 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks