fork(1) download
  1. class HelloWorld {
  2.  
  3. public static void main(String []args){
  4. //replace all char to 1 other then c and g
  5. String str = "abcdefghijklmnopqrstuvwxyz";
  6. if (str == null || str.length() == 0) {
  7. return;
  8. }
  9. String answer = str.replaceAll("[^cg]", "1");
  10. System.out.println(answer);
  11. }
  12. }
Success #stdin #stdout 0.04s 2184192KB
stdin
Standard input is empty
stdout
11c111g1111111111111111111