replaceAll replacing multiple strings

Joined
Oct 18, 2011
Messages
1
Reaction score
0
Hi,

Say I have a string with the format:

s = " one: two, three: four, five: six "

How do I use replaceAll to replace "one", "three", and "five" with "" without having to resort to s.replaceAll("one", "").replaceAll("three", "").replaceAll("six","");

That is, how do I combine all three replaceAll calls into one call?

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top