java- how to replace ? with another string

  YinHoNg 03:31 05 Nov 2004
Locked

Here is bit of my code:

String newText;
newText =text.replaceAll(",","");//replaces all commas with the empty string
newText =text.replaceAll(".","");//replaces all periods with the empty string
newText =text.replaceAll("?","");//replaces all the question marks with the empty string
newText =text.replaceAll("'","");//replaces all quotation marks with the empty string
newText =text.replaceAll("!","");//replaces all the exclamation marks with the empty string

They all work except the ? and the '. how do i get rid of them?

  Pesala 11:07 05 Nov 2004

I have a Javascript that replaces aa with ā for example. It uses character entities in the replace string. For ? it would be & #64 (remove the space or you will get @), for apostrophe it would be & #39

I don't know Javascript programming, but I guess this might work as the script that I have works fine.

  Pesala 11:09 05 Nov 2004

Sorry, that should be & #63 for ?

This thread is now locked and can not be replied to.

Elsewhere on IDG sites

OnePlus 5T review

How to draw a mandala

iPhone X review

Les meilleures enceintes Bluetooth à moins de 150 euros