0

public static void main(String[] args) {

    String text = "Вася заработал 5000 рублей, Петя - 7563 рубля, а Маша - 30000 рублей";
    String[] arr = text.split(", ");
    for (int i = 0; i < arr.length; i++) {
        arr[i].replaceAll("[^0-9]", "");
        System.out.println(arr[i]);
    };

i want to replace all of the letters with empty space

0 Answers0