fork download
  1. /* package whatever; // don't place package name! */
  2.  
  3. import java.util.*;
  4. import java.lang.*;
  5. import java.io.*;
  6.  
  7. /* Name of the class has to be "Main" only if the class is public. */
  8. class Ideone
  9. {
  10. public static void main (String[] args) throws java.lang.Exception
  11. {
  12. // reads the standard input
  13. String input = "";
  14. String currentLine;
  15. while ((currentLine=inputReader.readLine()) != null) { input+=currentLine; }
  16.  
  17. // actual process
  18. String toRemove="^A";
  19. System.out.println(input.replace(toRemove, ""));
  20. }
  21. }
Success #stdin #stdout 0.1s 36264KB
stdin
this is a large text from which I wish to remove all ocurrences of ^A. It obviously shouldn't remove anything else, such as ^B or $A. But this ^A here shouldn't be there anymore, nor this ^A there.
stdout
this is a large text from which I wish to remove all ocurrences of . It obviously shouldn't remove anything else, such as ^B or $A. But this  here shouldn't be there anymore, nor this  there.