Помогите сделать удаление всех символов с нескольких строк КРОМЕ пропуска
Сделал ввод нескольких строк с клавиатуры, нужно удалить все символы КРОМЕ пропуска и вывести результат.
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("Please enter the number of strings you want to enter: ");
String[] string = new String [sc.nextInt()];
sc.nextLine();
for (int i = 0; i < string.length; i++)
{
string[i] = sc.nextLine();
}
System.out.println("\nYou have enter: ");
for(String str: string)
{
System.out.println(str);
}
}
}