Results 1 to 2 of 2
- 02-17-2012, 04:31 AM #1Member
- Join Date
- Feb 2012
- Rep Power
Replace/remove character in a StringJava Code:
String tmpString = myString.replace( '\'', '*' ); System.out.println( "Original = " + myString ); System.out.println( "Result = " + tmpString );
So in this project I am trying to get a string from the user using the Scanner, and use that string, then replace certain letters with others and print it out. Above is a section of a tutorial I found on the web, but i am having trouble setting this up for myself. I am using the replace statement for this. Can someone please help me out with how to set this up and takes the user's string and replace? And are there any other statements that I might be able to use to aid in this process?
Thanks you a lot for any help. I really appreciate it. I am an amateur at this and am trying to learn.
Re: Replace/remove character in a String
You really need to make a good faith effort to try to solve this yourself first and then ask specific questions about problems with your code. Also, you should avoid borrowing any code from the internet if you don't understand it.
- By HearT.Hunt3r in forum New To JavaReplies: 4Last Post: 08-22-2011, 03:04 AM
- By aham in forum New To JavaReplies: 4Last Post: 05-17-2011, 08:46 AM
- By Raeghin in forum New To JavaReplies: 1Last Post: 07-28-2009, 03:58 PM
- By farnetani in forum LuceneReplies: 4Last Post: 02-13-2009, 11:10 AM
- By venkata.tarigopula in forum Advanced JavaReplies: 1Last Post: 07-10-2007, 08:14 PM