8 Replies Latest reply: Nov 19, 2007 5:43 AM by masijade RSS

    Not able to replace a String to String.

    807600
      Hi,
      I'm trying to replace a String to an another Stirng. But it is showing compiler error. Please have a look at the following code.
      String str = "Checking string replacement java";
      
      String newstr = str.replaceAll("java","j2ee"); // error for replaceAll
      The above code is showing an complier error.
      ...like replaceAll(Stirng,String) is undefined for a String type.

      please help me on this..

      Thanks in advance...