Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Beginning Java
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Beginning Java
string.replace limited to only one character.
Steve Nix
Greenhorn
Posts: 1
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Is there a way to use string.replace or another method to remove the occurrence of more than one character. In other words, how could I remove the
word
"cat" from the following
string
:
myString = "That dog ate the neighbors cat!"
Junilu Lacar
Sheriff
Posts: 17734
302
I like...
posted 23 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
The
StringBuffer
class has methods that will let you do what you want. Check out the delete() method.
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
String from JTextField
Special Characters
character representation of a blank space
String.replace to remove a character
replaceAll("+"," ")
More...