Παράδειγμα class ReplaceTest1 { public static void main(String[] args){ String s1 = Is this a greek question ; System.out.println( Before: + s1); s1 = s1.replace( , ; ); System.out.println( After: + s1); String s2 = This is not a question ; System.out.println( Before: + s2); s2 = s2.replace( , ); System.out.println( After: + s2); String s3 = 20-5-2013 ; System.out.println( Before: + s3); s3 = s3.replace( - , / ); System.out.println( After: + s3); } Αντικαθιστά το με ; Σβήνει το Αντικαθιστά όλα τα - με /
{}